MATLAB: Help please. i have 2 axes plots on the GUI , i want to reset the output plot(clear the previous output from plot) as i press the load image image button.
guiMATLAB
please help
Best Answer
In the LoadImage button callback:
% Reset first axes.
axes(handles.axes1); % Whichever axes you want to reset.
cla('reset');
% Reset second axes.
axes(handles.axes2); % Whichever axes you want to reset.
cla('reset');
axes(handles.axes1); % Whichever axes you want to display in.
If you add the following block of code to the end, it will show the wave propagating along the x-axis, but I don't think this is exactly what you envision - particularly since the variable PHI seems to be defined, but not used in the plot. I would imagine that defining a 2-dimensional variable where each column represents the amplitude at a time step and each row gives the amplitude of a specific x-location over time would be useful.
Best Answer