Matlab

How to clear plot in Matlab GUI

kpro 2021. 7. 27. 09:49

If you want to clear curve, bars, surfaces or whatever you plotted, then get the handle of the plot and delete it.

figure
x = -10:10;
y = x.^2;
h1 = plot(x,x.^2,'rx-'); grid on; hold on;
h2 = plot(x,x.^3,'bo-');

 

delete(h1)