How can I recreate this wave using the sawtooth wave function?

1 回表示 (過去 30 日間)
bribee
bribee 2017 年 5 月 19 日
編集済み: Walter Roberson 2017 年 5 月 20 日
I am trying to recreate this plot in matlab using the sawtooth() function. I have a good start, but I'm having a hard time figuring out where to go from here. Here is what I have started :
T = 3 * 4;
Fs = 1000;
dt = 1/Fs;
t=-5:dt:T-dt;
x = sawtooth (pi*t , 0.5);
plot(t-1,x)
grid on
axis ([-5 5 -1.5 1.5]);

回答 (1 件)

Michelangelo Ricciulli
Michelangelo Ricciulli 2017 年 5 月 19 日
Hi! You just need to slightly modify the function sawtooth, putting a minus sign before it and adding a division by a factor 2 inside :
x = -sawtooth (pi/2*t, 0.5);

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by