Trying to plot a sine wave???

9 ビュー (過去 30 日間)
DOL
DOL 2012 年 11 月 10 日
Hi guys Just gone back to college and about to hand in first assignment on matlab. Really isint looking correct would be very greatful if anybody could have a look and point out any mistakes. thanks.
A sine wave of amplitude 5 and frequency 0.1 Hz is applied to the input of an analogue device which has a constant gain of 1.5 over all frequencies. Use MATLAB to calculate the output signal for the intervals 0 to 10 seconds in increments of 0.1 seconds.
This is the code im using
EDU>> x=[0:0.1:10] EDU>> y=sin(x) EDU>> freq=0.1 EDU>> amp=5 EDU>> gain=1.5 EDU>> plot(x,y)
Thanks

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 11 月 10 日
x=[0:0.1:10]
freq=0.1
amp=5
gain=1.5
y=gain*amp*sin(2*pi*freq*x)
plot(x,y)
  1 件のコメント
DOL
DOL 2012 年 11 月 10 日
Brilliant, thanks Azzi.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by