MATLAB: Multiple plots on a subplot

multiple subplotsplotsubplot

I just want something generic so I can have two subplots and two graphs on each subplot. I know how to do the two subplots but having two different graphs on each subplot is the problem. Thanks

Best Answer

Use hold on
t=0:0.1:10;
y1=sin(t)
y2=cos(t)
subplot(2,1,1)
plot(t,y1)
hold on
plot(t,y2,'r')