MATLAB: How to plot this sine wave

plotsine wave

I am new to matlab and I am struggling with the basics. I was asked this question in class and I'm just not sure what to do "Plot one second of a sine wave with frequency 97 Hz and phase shift 97 (in degrees). The x-axis should be time not samples". Please help.

Best Answer

Dear Niamh, you can do the following way:
time = -1:0.01:1;
frequency = 97;
phase = 97;
phase_in_rad = degtorad(phase);
y = sin(2 * pi * frequency * time + phase_in_rad);
plot(time, y), xlabel('Time'), ylabel('Sine wave')
Do you need it or something else?
Related Question