How to change number of cycles by changing frequency to plot sine wave?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
x=sin(2*Pi*f*t)
0 Kommentare
Antworten (1)
檮杌
am 1 Okt. 2023
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")
0 Kommentare
Siehe auch
Kategorien
Mehr zu Legend finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!