How to sketch the following signal? x(t)= 3u(t-10)+ 4u(-t+3)-r​(t+2)+4r(t​)-2u(-t-2)​-2r(t-3)-2​u(t-4)+r(-​t-5)

28 views (last 30 days)
Since the question contains both step and ramp, how to write the code for it?
  11 Comments

Sign in to comment.

Accepted Answer

Birdman
Birdman on 20 Nov 2017
syms u(t) r(t) x(t) t0
u(t)=piecewise(t<t0, 0, t>=t0, 1);
r(t)=piecewise(t<t0, 0, t>=t0, t-t0);
t1=-6:0.01:10;
x(t)=3*u(t-10)+4*u(-t+3)-r(t+2)+4*r(t)-2*u(-t-2)-2*r(t-3)-2*u(t-4)+r(-t-5);
x=subs(x,{t0,t},{0,t1});
plot(t1,x)
Something like this should do it. Note that I defined the input range randomly. Hope this helps.

More Answers (0)

Categories

Find more on Entering Commands in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!