generate a sine and cosine wave with 4 cycles .

1 view (last 30 days)
MICHKEL ANGLO J
MICHKEL ANGLO J on 25 Jul 2021
Answered: Jan on 25 Jul 2021
Pls give be a code to generate a sine and cosine wave with 4 cycles . No specified frequency just want four cycles.
  2 Comments
MICHKEL ANGLO J
MICHKEL ANGLO J on 25 Jul 2021
U mean x=0:1:3; y=sin(x); stem(x,y);is it crt. I want discrete so I am using this stem fn. @jan

Sign in to comment.

Accepted Answer

Jan
Jan on 25 Jul 2021
0:1:3 is [0,1,2,3]. This is less than 4 cycles. 4 cycles mean:
x = 0:0.1:8*pi
stem() is working. plot(x,y, '.') is an option also.

More Answers (0)

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!