I generate a graph inside GUIDE and I want that when I change few parameters and I push the run button that I put in my GUI, the previous plot disappear and the new one based on the new parameters is shown.
Right now I plot like this
h1=plot(x1(ii)*1000,y1(ii)*1000,'o','MarkerSize',5,'color',C{ii});
hold on; grid on;
plot(x2(ii)*1000,y2(ii)*1000,'x','MarkerSize',10,'color',C{ii});
drawnow
Using drawnow
when I modify the parameters x2,y2
the new plot is displayed, but the previous values of x2,y2
remain. How can I delete the old values and update the graph using the new values?