Home > RPSstuff > thumbfin.m

thumbfin

PURPOSE ^

FUNCTION THUMBFIN rejects data outside a user-specified range.

SYNOPSIS ^

function uout=thumbfin(u,umin,umax,goplot)

DESCRIPTION ^

FUNCTION THUMBFIN  rejects data outside a user-specified range.
                   "Thumb-finger filter"

  function uout=thumbfin(u,umin,umax,[goplot])
           u = data vector
           umin= rejects data below this value
           umax= rejects data above this value
           goplot = optional 4th argument which plots the data, and
                    flags the bad points.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function uout=thumbfin(u,umin,umax,goplot)
0002 %FUNCTION THUMBFIN  rejects data outside a user-specified range.
0003 %                   "Thumb-finger filter"
0004 %
0005 %  function uout=thumbfin(u,umin,umax,[goplot])
0006 %           u = data vector
0007 %           umin= rejects data below this value
0008 %           umax= rejects data above this value
0009 %           goplot = optional 4th argument which plots the data, and
0010 %                    flags the bad points.
0011 g=find(~isnan(u));
0012 bad=find( (u(g)<umin)|(u(g)>umax) );
0013 uout=u;
0014 if length(bad)>0
0015        uout(g(bad))=ones(1,length(bad))*NaN;
0016 end
0017 if (nargin>3)&(length(bad)>0)
0018       plot(g,u(g),g(bad),u(g(bad)),'x')
0019 end

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