Hello, I want to plot 3 graphs in a single figure. I want to use the subplot command. However, I am unable to plot the graph vertically.
eg:
x = 0:5;
y = sin(x);
z = log(y);
subplot(2,2,1:3), plot(x,y)
subplot(2,2,2), plot(y,z)
subplot(2,2,4), plot(x,z)
This code does not work properly.
However, if I try to plot the graph horizontally, it works very well
eg:
x = 0:5;
y = sin(x);
z = log(y);
subplot(2,2,1:2), plot(x,y)
subplot(2,2,3), plot(y,z)
subplot(2,2,4), plot(x,z)
why is this so ? How can I plot vertically ?
Harshal
Best Answer