开发者

what is a valid handle for Matlab?

开发者 https://www.devze.com 2023-02-20 14:47 出处:网络
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\".

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:

- A valid handle (in this case a Handle Graphics Object called 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消