From help-request at octave dot org Sun Feb 6 17:29:37 2005 Subject: Re: unit sample sequence ->step From: "Jonathan C. Webster" To: NZG CC: Geordie McBain , help@octave.org Date: Sun, 06 Feb 2005 18:24:21 -0500 Without the "for"s and "if"s try retval = t > 0; Jonathan NZG wrote: > It does, my bad, I meant the unit step. > > function retval = u(t) > for i = 1:length(t) > if (t(i) >= 0) > retval(i)=1; > else > retval(i)=0; > endif > endfor > endfunction > > > ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------