Question: How to write a functionMatlab?First write the matlabsCriptsfunction ( u for the unitstep function, rec for therectangular function andrn for the triangularpulse ) . Matlab

How to write a functionMatlab?First write the matlabsCriptsfunction (u for the unitstep function, rec for therectangular function andrn for the triangularpulse).Matlab functionE Che unit stepfuncti on y u(t)y 1.*(t>=0};Example of usecreated--3:0.001:3;functionoftheTunctlonxlabel (t')the y axisplotlabeltsirs)$ 1abelaxis ([-33-121)8ie x and y-asesqrid on this adcthe grid fot bettermeasurementstitlePlot theunit step functionult)'t1):endMatlab functionrectangular functionfunction y rec(t)Matlab functiotriangular functiorfunetion y tri[t)y=(1-D.*(t1 &Use of functions in aseparate m-ffle& Example of use ofStep functiont-3:0.001:3:plot (t, u(t))8 plotxlabel (t)8 labelthe x-axisPRACTICEaxis ([-33-12]) &de finie % and y-asesuit)arid on 9 th is adarhe grid for bettermeasurementsCunerion-axis8 Exanple of use offunctiont=-3:0.001:3;plot (t, rec(t))xlabel('t' & labethe xaxisylaberec(t))uni stepaxis ([-33-12])&de finie x and y-asesarLd n & this addthe grid for bettermeasurements,Example of use ofeweat funetiont--3:0,001 :3;plot (t, tri(t))reetheuni stepxlabel('t')& labethe x-axisylabeELaxis ([-33-121)%de finie x and y-aSesmeasurementsarid on & this addthe grid for betterOt of theGraphical resultsHota tne uni slkp funciion uilAot o the rect. functiotn rec(yPut of the tri. function rec|1y=1,*(t-0,5 &
Exax -8(t)2*(rec (t)-rec (t-1))plot (t,x (t), linewidth',1.5)8 plot thean *1t WIth 1inewi th of size 1.5xlabel ('t'} label the x-axisylabel("x(t)')8 label the y-axisaxis {[-33-33]}% definie x and y- asesgrid on this add the grid for bettermeasurementst20.001+3:boldnessxg(t)2*(tri(t)-tri (t-1))use of rect, functions.o01:3:1imisxlabel (t') & label the x-axistirlenversion:grid on & this add the grid for better: of the functi on x(t))SPlotting of a function with its trans formed.1gnal operations-331-A(E)0+(-t),*rect it+1)./2)+ u(t)-u (t-1)+ tri(t-2):ubpeot(21) to plot 2 graphs on theand y-asesplot (t,x(t),'linewidth',1.5) & plot thefunetion x{t) with linewith of size 1.5 forv) abeltt) label the x-axisylabel('x(t)')8 label the y- axisaxis ([-34-35])8 definie x and y-aseson & this add the grid for bettersrementstitle (Plot of the function x(t))y-2*x (-2*t+2):s ame figureboldnesss ubplot (2,1,2) &to plot 2 graphs on the1imirsxlabel(t) & label the x-axisya -3511tirlforkne 1.5 foraua nd yasesqrid on & this add the grid for betterof the function y(t)-2x (-2t+2)')
Part 1:
[10]
Consider the signal x(t) shown in Fig. 1.
Remark: the lowest amplitude value is -12, i.e.x(t)=-12 for x(t)x(t)f(t)=x(2t-5)g(t)=x(2-4t)3.
Express the signal x(t)in terms of unit step functions.
Use the given MATLAB function above to sketch the signal x(t).
Sketch the signal f(t)=x(2t-5).
Sketch the signal g(t)=x(2-4t).
(2)
(3)
(3)
How to write a functionMatlab?First write the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!