%Zeros' Addition Effect on Linear System Output with Step as Input syms s t a %modifying symbolic variables T = -7:0.05:1.3; Y=2/s/(s^2+2*s+2); pretty(Y); %pretying Y so that function type correctness checking become easier y=ilaplace(Y); %inverse Laplace yT = double(subs(y,t,T)); %directly plotting a symbolic variables, without "using ezplot(y)" and with "hold on" Y=(s+.1)*2/.1/s/(s^2+2*s+2); y1=ilaplace(Y); y1T = double(subs(y1,t,T)); % substitustion of t: a common variable and T: a symbolice variabl, enabling us to use "plot" function Y=(s+.5)*2/.5/s/(s^2+2*s+2); y2=ilaplace(Y); y2T = double(subs(y2,t,T)); Y=(s+1)*2/1/s/(s^2+2*s+2); y3=ilaplace(Y); y3T = double(subs(y3,t,T)); Y=(s+1.5)*2/1.5/s/(s^2+2*s+2); y4=ilaplace(Y); y4T = double(subs(y4,t,T)); Y=(s+2)*2/2/s/(s^2+2*s+2); y5=ilaplace(Y); y5T = double(subs(y5,t,T)); Y=(s+5)*2/5/s/(s^2+2*s+2); y6=ilaplace(Y); y6T = double(subs(y6,t,T)); Y=(s+10)*2/10/s/(s^2+2*s+2); y7=ilaplace(Y); y7T = double(subs(y7,t,T)); plot(T,yT,T,y1T,T,y2T,T,y3T,T,y4T,T,y5T,T,y6T,T,y7T,'LineWidth',1); % plotting and turing hold off for other programs title('Zeros` Addition Effect on Linear System Output with Step as Input'); %title of figure legend('y','a=.1','a=.5','a=1','a=1.5','a=2','a=5','a=10',... 'Location','Best') %legends xlabel('t'); xlim([-6.4 1.2]) % axes' labels and limitations ylabel('y(t)'); ylim([-550 500]); set(gca,'YGrid','on') %only YGrid on text(-5,-350,'System Output to Unit Step Input',... %description 'HorizontalAlignment','left') text(-5,-250,'T(s)= 2*(s+a)/a/(s^2+2*s+2) and U(s)=1/s',... %description 'HorizontalAlignment','left') T=2*(s+a)/a/(s^2+2*s+2); pretty(T)