close all clear all clc t = -1:.01:5; s = (t>=0).*exp((-1+1i*2*pi)*t); figure subplot(2,2,1) plot(t,real(s)) grid on axis([-1 5 -1.1 1.1]) title('real part') subplot(2,2,2) plot(t,imag(s)) grid on axis([-1 5 -1.1 1.1]) title('imaginary part') subplot(2,2,3) plot(t,abs(s)) grid on axis([-1 5 -.1 1.1]) title('absolute value') subplot(2,2,4) plot(t,angle(s)) grid on yticks([-pi,-pi/2,0,pi/2,pi]) yticklabels({'-\pi','-\pi/2','0','\pi/2','\pi'}) axis([-1 5 -3.5 3.5]) title('phase') % printing figure in png format set(gcf,'PaperUnits','inches','PaperPosition',[0, 0, 8/1.5, 6/1.5]) print -dpng homework4.png -r100