Home > RPSstuff > gmin.m

gmin

PURPOSE ^

GMIN Similar to MIN, but for "good" points (finite points).

SYNOPSIS ^

function xnew=gmin(x)

DESCRIPTION ^

 GMIN  Similar to MIN, but for "good" points (finite points).

 DESCRIPTION:  For vectors, GMIN(X) is the smallest element of the
       finite points in X.  If there are no finite points, the value
       of NaN is returned.   For matrices, GMIN(X) is a vector 
       containing the minimum element of the finite values
       from each column. 

 Rich Signell (rsignell@usgs.gov)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function xnew=gmin(x)
0002 % GMIN  Similar to MIN, but for "good" points (finite points).
0003 %
0004 % DESCRIPTION:  For vectors, GMIN(X) is the smallest element of the
0005 %       finite points in X.  If there are no finite points, the value
0006 %       of NaN is returned.   For matrices, GMIN(X) is a vector
0007 %       containing the minimum element of the finite values
0008 %       from each column.
0009 %
0010 % Rich Signell (rsignell@usgs.gov)
0011 
0012 [imax,jmax]=size(x);
0013 
0014 for j=1:jmax
0015        good=find(finite(x(:,j)));
0016        if length(good)>0
0017           xnew(j)=min(x(good,j));
0018        else
0019           xnew(j)=NaN;
0020        end
0021 end

Generated on Wed 30-Nov-2005 14:45:02 by m2html © 2003