MATLAB: Append one graph to another

appendgraphshold onplot

Hi guys, How to append one graph to another? Tried using 'hold on' but it doesn't work. Thanks.

Best Answer

Use plotyy
% Example
x=0:0.01:10
y1=sin(x)
y2=100*cos(x)
plotyy(x,y1,x,y2)