To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016
I am having some trouble plotting a sine wave and i'm not sure where i am going wrong.
t = [0:0.1:2*pi] a = sin(t); plot(t,a)
this works by itself, but i want to be able to change the frequency. When i run the same code but make the change
a = sin(2*pi*60*t)
the code returns something bad. What am i doing wrong? How can i generate a sin wave with different frequencies?
No products are associated with this question.
%% Time specifications: Fs = 8000; % samples per second dt = 1/Fs; % seconds per sample StopTime = 0.25; % seconds t = (0:dt:StopTime-dt)'; % seconds
%% Sine wave: Fc = 60; % hertz x = cos(2*pi*Fc*t);
% Plot the signal versus time: figure; plot(t,x); xlabel('time (in seconds)'); title('Signal versus Time'); zoom xon;