angle is a MATLAB® function.
Generate a signal and compute its DFT. Find the phase of the transform and plot it as a function of frequency.
t = (0:99)/100; % Time vector x = sin(2*pi*15*t) + sin(2*pi*40*t); % Signal y = fft(x); % Compute DFT of x p = unwrap(angle(y)); % Phase f = (0:length(y)-1)/length(y)*100; % Frequency vector plot(f,p) xlabel 'Frequency (arb.)' ylabel 'Phase (rad)'