Global Index (short | long) | Local contents | Local Index (short | long)
[ minval, maxval ] = range( array );
function [ minval, maxval ] = range( array ); Calculates the minimum and maximum values for the first row of a matrix. The algorithm will also calculate the range of a column matrix. The algorithm disregards the NaNs. Todd Mitchell, April 1994.
This function is called by | |
---|---|
function [ minval, maxval ] = range( array ); % If necessary, convert a column matrix to a row matrix. array = array(:); x = array( ~isnan( array ) ); if ~isempty(x) minval = min( x ); maxval = max( x ); disp( sprintf( '\n minimum: %5d \n maximum: %5d', minval, maxval ) ) else minval = NaN; maxval = NaN; disp( sprintf( '\n All values are "NaN"s.\n' ) ); end