How to add Hann 5 cycles to the sine wave plot?

조회 수: 2 (최근 30일)
Ramesh Bala
Ramesh Bala 2019년 8월 9일
댓글: Ramesh Bala 2019년 8월 9일
I would like to know how to add cycle to the sine plots?
The below one is a sine plot continuous how to make it short for only 5 cycles?where x here is the time and 200 is the load (kHz)
plot(x,sin(2*pi*200e3*x))
  댓글 수: 2
darova
darova 2019년 8월 9일
One full cycle of sine is 2pi
You should make your argument of sine: 0 .. 2pi*5
Change your x such that:
0 ... 2pi*200e3 0 ... 2pi*5
Ramesh Bala
Ramesh Bala 2019년 8월 9일
Hi Daravo
But my x is time vector
load('x.mat')
sf=200e3;
sinewave=sin(2*pi*sf*x);
figure(1);
plot(x, sinewave);
The above code gives a continuous sine plot
Note : kindly put your answers in the answer section as this will help me to accept it and vote it
Thanks

댓글을 달려면 로그인하십시오.

채택된 답변

darova
darova 2019년 8월 9일
One full cycle of sine is 2pi
You should make your argument of sine: 0 .. 2pi*5
img11.png
  댓글 수: 14
darova
darova 2019년 8월 9일
I did my best :(
Ramesh Bala
Ramesh Bala 2019년 8월 9일
Ah kien problem Thank you so much :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by