Generate a Sine Wave in which I can change the sampling rate.

2 次查看(过去 30 天)
i wish to generate a basic sine wave and then plot it.
i then wish to take that basic sine wave and change the sampling rate (say from 1 to 10 to 100 to 1000 sampling points).
i do not have simulink. thanks.

采纳的回答

Adriano Bittar
Adriano Bittar 2014-8-11
编辑:Adriano Bittar 2014-8-11
%asks for sample rate
sample_rate = input('Type the sample rate:\n')
%time
t=0:2*pi/sample_rate:2*pi;
%discrete plot
stem(t,sin(t))

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by