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

15 ビュー (過去 30 日間)
Rory
Rory 2014 年 8 月 11 日
コメント済み: Rory 2014 年 8 月 14 日
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))
  3 件のコメント
Adriano Bittar
Adriano Bittar 2014 年 8 月 11 日
Anytime.
Rory
Rory 2014 年 8 月 14 日
would you know how to make the plot have an x-axis of 0-7 milliseconds and the y axis to have -30 to +50 millivolts?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by