필터 지우기
필터 지우기

How to change number of cycles by changing frequency to plot sine wave?

조회 수: 2 (최근 30일)
Shan Ali
Shan Ali 2023년 10월 1일
답변: 檮杌 2023년 10월 1일
x=sin(2*Pi*f*t)

답변 (1개)

檮杌
檮杌 2023년 10월 1일
t = linspace(0, 1, 100);
f1 = 1; % Hz
f2 = 2; % Hz
x1 = sin(2*pi*f1*t);
x2 = sin(2*pi*f2*t);
plot(t, x1);
hold on;
plot(t, x2);
xlabel("time(s)");
ylabel("Amplitude");
legend("1 Hz", "2 Hz")

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by