Home > utility > vecRatio.m

vecRatio

PURPOSE ^

SYNOPSIS ^

function output=vecRatio(vec)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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);

Generated on Tue 01-Jun-2010 09:50:34 by m2html © 2003