Trying to plot a sine wave, getting a straight line.
37 views (last 30 days)
I need to create a time series using x(n)=sin(2pi/N)*n where N=256 and plot the amplitude. I keep getting a straight line instead of a sine wave. Any pointers?
%Create time series x(n)
x=zeros(N,1); %allocate space
Roger Stafford on 9 Feb 2018
You have placed your ’n’ variable outside the parentheses for the sine function. That would make it a straight line. It should be this to get a sine curve: