




0001 function output=vecRatio(vec) 0002 vecMin=min(vec); 0003 vecMax=max(vec); 0004 if vecMin==vecMax 0005 fprintf('Warning: the range of the input vec is zero!\n'); 0006 output=0.5*ones(size(vec)); 0007 return 0008 end 0009 0010 output=(vec-vecMin)/(vecMax-vecMin);