how to generate a sin function of time ....
29 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
aa
am 14 Sep. 2020
Kommentiert: Image Analyst
am 14 Sep. 2020
how to generate a sine function of time with 1024 second long ... and generate 8 full cycle over this interval ....
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 14 Sep. 2020
Bearbeitet: Image Analyst
am 14 Sep. 2020
How many samples do you want over that 1024 seconds? Let's say it's 50,000:
numSamples = 50000;
t = linspace(0, 1024, numSamples);
period = numSamples / 8; % Want 8 full cycles
amplitude = 1; % Whatever.
y = amplitude * sin(2 * pi * t / period);
plot(t, y, 'b-', 'LineWidth', 2);
grid on;
xlabel('t', 'FontSize', 20);
ylabel('y', 'FontSize', 20);
2 Kommentare
Image Analyst
am 14 Sep. 2020
numSamples = 1024;
t = linspace(0, 1024, numSamples);
period = numSamples / 8; % Want 8 full cycles
amplitude = 1; % Whatever.
y = amplitude * sin(2 * pi * t / period);
plot(t, y, 'b-', 'LineWidth', 2);
grid on;
xlabel('t', 'FontSize', 20);
ylabel('y', 'FontSize', 20);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Multidimensional Arrays 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!