How to generate a 256 point sine wave of frequency 1Hz

3 views (last 30 days)
Hi all,
Please help me to generate a 256 point sine wave of frequency 1Hz sampled at a frequency of 50Hz. And I need to plot it for 5 secs. This is the code I wrote but I don't know whether it's correct or not.
f=1;
Fs1 = 50;
Ts1=1/Fs1;
t1=[0:Ts1:5];
W1=sin(2*pi*f*t1);
plot(t1,W1,'r-')

Answers (0)

Community Treasure Hunt

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

Start Hunting!