I am having a simple GUI with two pushbuttons. One of them is plotting a single plot, one is plotting two subplots. However, once I push the subplot option, I cannot go back to the single plot. I am getting an error:
error using axes, invalid object handle
Please see below my very simple example:
function plot_push1_Callback(hObject, eventdata, handles)
load('test.mat')
axes(handles.axes1)
cla(handles.axes1,'reset')
plot(x,x.^(n+1));
function push_plot2_Callback(hObject, eventdata, handles)
load('test.mat')
axes(handles.axes1)
cla(handles.axes1,'reset')
subplot(2,1,1);
plot(x,x.^(0));
subplot(2,1,2);
plot(x,x);