|
%%
t = -10 : 0.001 : 10;
x = 0.*(t<-2) + (-4-(2.*t)).*(t>=-2 & t<0) + (-4+(3.*t)).*(t>=0 & t<4) + (16-(2.*t)).*(t>=4 & t<8) + 2.*(t>=8);
hold on
plot(t, x, 'r')
plot(t+1, x.*3, 'c')
plot(4.*t, x./2, '--m')
plot((t-1)./2, -2.*x, ':b')
grid on
hold off
%%
I have to plot
3x(t +1), (1/2) x(4t), -2x((t-1)/2)
Amplitude and Time scaling is correct (do tell me if anything is wrong) here but Time scaling is always wrong.
Could you help me in plotting with correct time scaling ?
I wish to know if there is shorter way to do it, 'cause I know if I replace 't' with t+1 or t-1, then I will get correct answer.
:\
thanks
|