how can i plot a sine wave which is 5*sin(2*pi*50*t) for 20 seconds and 5*sin(2*pi*55*t) for next 30 seconds and again repeating 5*sin (2*pi*50*t)

9 ビュー (過去 30 日間)
i need to plot a sine wave of 5*sin(2*pi*50*t) for 20 seconds and 5*sin(2*pi*55*t) for 21 to 50 seconds..how can i plot a above mentioned signal using matlab programme?

採用された回答

Wayne King
Wayne King 2012 年 7 月 6 日
編集済み: Wayne King 2012 年 7 月 7 日
Your title has something very different from your actual post, so I'm not sure what you actually want. And following your post, did you really want a 1 second gap with no sine wave? This does want you state in the actual body of your post.
t = 0:1/200:50;
x = zeros(size(t));
x = 5*sin(2*pi*50*t).*(t<=20)+5*sin(2*pi*55*t).*(t>20);
plot(t,x)
  3 件のコメント
Wayne King
Wayne King 2012 年 7 月 7 日
Basically, that is exactly the answer I gave you initially. I have removed the 1 second pause now. See the above example.
mskumarsajeesh mskumar
mskumarsajeesh mskumar 2012 年 7 月 29 日
編集済み: mskumarsajeesh mskumar 2012 年 7 月 29 日
Its worked correctely thanks for your help...

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by