Mercurial > hg > ishara
view general/numerical/normalise01.m @ 22:4f5015db91aa
Moved maxnormalise to unitmax
author | samer |
---|---|
date | Thu, 17 Jan 2013 14:23:21 +0000 |
parents | 8476b3d9d295 |
children |
line wrap: on
line source
function x=normalise01(x,dim) % normalise01 - scale and shift all values into the range [0,1]. % % normalise01 :: [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));