matlab code for filter

Søren Hauberg soren at hauberg.org
Wed Feb 4 06:16:00 CST 2009


ons, 04 02 2009 kl. 07:09 -0500, skrev Ben Abbott:
> The two lines below, will run fine in Octave.
> 
> > belowzero=pethsmooth<0;
> > pethsmooth(belowzero)=0;
> 
> It would be easier (and I think clearer) to write
> 
> 	pethsmooth (pethsmooth<0) = 0;

Or

  pethsmooth = max (pethsmooth, 0);

Søren



More information about the Help-octave mailing list