Mercurial > hg > ishara
view general/numerical/map01.m @ 16:db7f4afd27c5
Rearranging numerical toolbox.
author | samer |
---|---|
date | Thu, 17 Jan 2013 13:20:44 +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));