I am newbie with Matlab. I am learning through the Matlab Documentation. At these moments, I am doing the example "A GUI to Set Simulink Model Parameters".
At the section "Closing the GUI" of the mentioned one, it appears the following code for the Close
button callback:
function CloseButton_Callback(hObject, eventdata, handles)
% Close the GUI and any plot window that is open
if isfield(handles,'PlotFigure') && ...
ishandle(handles.PlotFigure),
close(handles.PlotFigure);
end
close(handles.F14ControllerEditor);
I am trying to understand what a valid handles is by parsing the behaviour of
the handle handles.PlotFigure
. I have inserted a breakpoint in the line number
four of the code above and I have run the program in debugging mode. After doing that, my conclusion is:
handles.PlotFigure
) is an object which has not been deleted (closed) by some command.
However, I do not understand why the handle field handles.PlotFigure
remains inside the handles structure and it has not been deleted.
Another surprise I found out while I was debugging was that the Variable Editor said "No valid plots for handles.PlotFigure{1,1}". I neither understand this because the figure for h开发者_Go百科andles.PlotFigure did exist.
I would be thankful if someone run the example and can explain me my doubts.
精彩评论