How can I generate a sinusoidal wave in Matlab in one plot?

3 ビュー (過去 30 日間)
Joseph Lopez
Joseph Lopez 2022 年 7 月 27 日
回答済み: Voss 2022 年 7 月 27 日
Duration 0-1, Step 0.02
Frequency 20 Hertz
Plot it across time duration (t)

採用された回答

Voss
Voss 2022 年 7 月 27 日
t_start = 0;
t_end = 1;
t_step = 0.002; % 0.002 looks more like a sinusoid than 0.02, but do what you like
f = 20;
t = linspace(t_start,t_end,round((t_end-t_start)/t_step)+1);
x = sin(2*pi*f*t);
plot(t,x);

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by