Mercurial > hg > ishara
view general/numerical/map01.m @ 6:0ce3c2070089
Removed duplicate code and fixed doc in timed_action.
author | samer |
---|---|
date | Mon, 14 Jan 2013 14:33:37 +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));