Home > RPSstuff > denan.m

denan

PURPOSE ^

DENAN removes all the rows of a matrix that contain NaNs.

SYNOPSIS ^

function unew=denan(u);

DESCRIPTION ^

 DENAN removes all the rows of a matrix that contain NaNs.
   
 unew=DENAN(u);

 Version 1.0 (12/4/1996) Rich Signell (rsignell@usgs.gov)
 Version 1.1 (4/16/1999) Rich Signell (rsignell@usgs.gov)
    fixed bug so that denan now works for single column vectors

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function unew=denan(u);
0002 % DENAN removes all the rows of a matrix that contain NaNs.
0003 %
0004 % unew=DENAN(u);
0005 %
0006 % Version 1.0 (12/4/1996) Rich Signell (rsignell@usgs.gov)
0007 % Version 1.1 (4/16/1999) Rich Signell (rsignell@usgs.gov)
0008 %    fixed bug so that denan now works for single column vectors
0009 %
0010 unew=u;
0011 [m,n]=size(u);
0012 if(n==1),
0013   ii=find(isnan(u));
0014 else
0015   ii=find(isnan(sum(u.')));
0016 end
0017 unew(ii,:)=[];

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