help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: triangular wave


From: Ben Abbott
Subject: Re: triangular wave
Date: Tue, 20 May 2008 07:06:47 -0400


On May 20, 2008, at 3:09 AM, javier wrote:

Sorry for my English
Someone knows how to create a vector with a triangular wave?
And a square wave?

Something like this but with a signal triangular:

seno=10*sin(2*pi*10);

Does this do what you're looking for?

n = 0:100;
a = (-1).^n;
x = 0:0.01:100;
y = interp1 (n, a, x);
plot (x, y)

There may be an existing function, but I'm not aware of it.

Ben


reply via email to

[Prev in Thread] Current Thread [Next in Thread]