view general/numerical/map01.m @ 19:1eb0ea29ec40

Doesn't belong here.
author samer
date Thu, 17 Jan 2013 13:32:19 +0000
parents e44f49929e56
children
line wrap: on
line source
function x=map01(x,dim)
% map01 - Map values into the range [0,1].
%
% map01 :: [Size], D:natural -> [Size].

if nargin<2, 
	sz=size(x);
	dims=find(sz>1);
	if isempty(dims), dim=1; else dim=dims(1); end
end
	
x=divnorm(@(z)max(z,[],dim),addnorm(@(y)min(y,[],dim),x));