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

조회 수: 2 (최근 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 CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by