What am i doing wrong in this code
Show older comments

i am ploting these graphs in matab ...............i have written the equations as given in the book but the plots are not coming as they are shown in the book .............am i doing any thing wrong.............the attached file is the output of my code on matlab
clear all
clc
t=[0 1 2]
x=[1 1 0]
subplot(5,1,1)
plot(t,x)
xlabel('time axis')
ylabel('amplitude')
title(' x(t)')
grid on
axis([-2 5 0 2])
x1=(t+1)
subplot(5,1,2)
plot(x1,x)
xlabel('time axis')
ylabel('amplitude')
title(' x(t+1)')
grid on
axis([-2 5 0 2])
x2=(-t+1)
subplot(5,1,3)
plot(x2,x)
xlabel('time axis')
ylabel('amplitude')
title(' x(-t+1)')
grid on
axis([-2 5 0 2])
xt=3*t
x3=(xt/2)
subplot(5,1,4)
plot(x3,x)
xlabel('time axis')
ylabel('amplitude')
title(' x(3*t)/2)')
grid on
axis([-2 5 0 2])
x4=x3+1
subplot(5,1,5)
plot(x4,x)
xlabel('time axis')
ylabel('amplitude')
title(' x((3*t)/2)+1)')
grid on
axis([-2 5 0 2])
Accepted Answer
More Answers (0)
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!