How to plot DFT spectrum in MATLAB?
To plot the magnitude and phase in degrees, type the following commands: f = (0:length(y)-1)*100/length(y); % Frequency vector subplot(2,1,1) plot(f,m) title('Magnitude') ax = gca; ax. XTick = [15 40 60 85]; subplot(2,1,2) plot(f,p*180/pi) title('Phase') ax = gca; ax.
How do you plot a frequency plot in MATLAB?
plot(f,abs(X)/N); xlabel('Frequency (in hertz)'); title('Magnitude Response');