sawtooth plot with specific x ,y limits

Hi every one, How can I plot as saw tooth plot with exact x, y limits as attached image?
Thanks in advance

 採用された回答

madhan ravi
madhan ravi 2018 年 11 月 3 日
編集済み: madhan ravi 2018 年 11 月 3 日

1 投票

T = 10*(1/50);
Fs = 1000;
dt = 1/Fs;
t = 0:dt:T-dt;
x = sawtooth(2*pi*50*t);
plot(t,x)
xlim([0 0.2])
ylim([-1 1])
grid on

7 件のコメント

Oday Shahadh
Oday Shahadh 2018 年 11 月 3 日
thanks Ravi, I tried to make changes in this ready script but I failed T = 10*(1/50); Fs = 1000; dt = 1/Fs; t = 0:dt:T-dt; x = sawtooth(2*pi*50*t);
plot(t,x) grid on
madhan ravi
madhan ravi 2018 年 11 月 3 日
編集済み: madhan ravi 2018 年 11 月 3 日
it worked for me:
T = 10*(1/50);
Fs = 1000;
dt = 1/Fs;
t = 0:dt:T-dt;
x = sawtooth(2*pi*50*t);
plot(t,x)
xlim([0 30])
ylim([0 4])
Oday Shahadh
Oday Shahadh 2018 年 11 月 3 日
it works but not with the new required axes values y from 0 to 4 x from 0 to 30
madhan ravi
madhan ravi 2018 年 11 月 3 日
actually its working you have apply lower limits , see edited answer
Oday Shahadh
Oday Shahadh 2018 年 11 月 3 日
close all T=6; Fs=10000; dt = 10/Fs; t = 0:dt:T-dt; x = sawtooth(2*pi*t); % <— REMOVE THE ‘-10’ HERE x = x*4; % <— ADD THIS LINE t=t*5; plot(t,x) grid on
Oday Shahadh
Oday Shahadh 2018 年 11 月 3 日
done, so thanks
madhan ravi
madhan ravi 2018 年 11 月 3 日
glad that you found

サインインしてコメントする。

その他の回答 (1 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by