MATLAB: How to plot complex functions of phase and amplitude

plotting

I am trying to use f(t)=(1+0.25i)t–2.0 to plot the amplitude and phase of function f for 0 less than or equal to t less than or equal to 4 on two separate subplots within a single figure.

Best Answer

Try this:
f = @(t) (1+0.25i).*t-2.0;
t = linspace(0, 4);
figure
subplot(2,1,1)
plot(t, abs(f(t)))
title('Amplitude')
subplot(2,1,2)
plot(t, angle(f(t)))
title('Phase')