% question1 % figure(1) t=0:0.01:5; xt=(10*exp(-1*t))-(5*exp(-0.5*t)); plot(t,xt) xlabel('t VALUES') ylabel('xt VALUES') title('xt versus t values') % question2 % figure(1) t=0:0.01:5; xt=(10*exp(-1*t))+(5*exp(-0.5*t)); plot(t,xt) xlabel('t VALUES') ylabel('xt VALUES') title('xt versus t values') % question3 % m=1e-3; t=-2*m:0.01*m:2*m; a=0; for i=1:4 a=a+250; xt=(20*sin((2*pi*1000.*t)-(pi/3))).*(exp(-1.*a.*t)); subplot(4,1,i) plot(t,xt) end % question4 % %write this function in m-file and save it as piecex1.m% function y=piecex1(t) a=length(t); for i=1:a if 1<=t(i) & t(i)<=10 y(i)=10; else y(i)=0; end end %write this in command window% t=-10:0.01:20; plot(t,piecex1(t)) xlabel('t values') ylabel('x values') title('x values versus t values')