From help-request at octave dot org Mon Apr 10 10:43:49 2006 Subject: Re: square waves From: NZG To: Paul Kienzle Cc: Doug Stewart , help@octave.org Date: Mon, 10 Apr 2006 10:39:06 -0500 On Saturday 08 April 2006 5:48 am, Paul Kienzle wrote: > Octave-forge has the compatibility functions pulstran and rectpuls > which can do the same thing: > >         n = 8*350; >      x = pulstran([1:n],[101:350:n],'rectpuls',250); Looks nice, thanks. >See also the function square just added to octave-forge. Same thing Matlab has, nice for compatibility but I don't like it because you don't get what you expect when you plot it, interpolation gives you a trianglish wave instead of a square. I think it really needs to use more points to more closely approx. a true square. NZG ------------------------------------------------------------- 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 -------------------------------------------------------------