Hi everyone! I use subplot to draw two plots. How can i delete any plot on each subplot? Why i use clf(p1), plot on second subplot is deleted? My code:
subplot(2,1,1);hold onx1=(0:0.01:10);y1=sin(x1);p1=plot(x1,y1);subplot(2,1,2)hold onx1=(0:0.01:10);y2=sin(x1)+cos(x1);p2=plot(x1,y2,'Color','r');clf(p2)clf(p1)
Best Answer