how can i plot a half sine wave plot or a cosine wave which has a origin as a centre ?

12 ビュー (過去 30 日間)
can we plot a sine wave which half wave i.e. positive side only
can we plot same sine wave in reverse direction from above plot
what can i use if exist either matlab .m file or simulink
or
how can i plot a cosine wave which has a centre on origin

採用された回答

Adam Danz
Adam Danz 2019 年 4 月 18 日
編集済み: Adam Danz 2019 年 4 月 19 日
"can we plot a sine wave which half wave i.e. positive side only"
Yes. Here's a hint. This produces one full cycle of a sin curve between -pi and pi. You'll want to plot it from 0 to pi.
x = -pi : 0.01 : pi;
y = sin(x);
plot(x,y)
grid on
"can we plot same sine wave in reverse direction from above plot "
I'm not sure what this means. Perhaps you want the section between -pi and 0?
" how can i plot a cosine wave which has a centre on origin "
Hint: use cos() instead of sin().
  4 件のコメント
madhan ravi
madhan ravi 2019 年 4 月 20 日
Adam the OP has asked the same question again and he seems to have solved his problem.
sesha sai
sesha sai 2019 年 4 月 20 日
it was working thank you sir
but how to change amplitude and how it can be converted as a source block for simulink

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by