Stuart’s MATLAB Videos

Watch and Learn

Advanced: Getting an output from a GUIDE GUI

I had a well formed question from an advanced MATLAB user recently. He wanted to have an output come back from a GUI. There is an example of this with the modal dialog example in GUIDE. However, it takes some effort to know what parts of the example give this particular behavior. In this video, I make a very simple GUI that gives a return value by pasting from that example.
Here is the code I copied and pasted:

%%% OpeningFCN
uncomment uiwait

%%% OutputFCN
varargout{1} = handles.output;
% The figure can be deleted now
delete(handles.figure1);

%%% CloseReqFCN
if isequal(get(hObject, 'waitstatus'), 'waiting')
% The GUI is still in UIWAIT, us UIRESUME
uiresume(hObject);
else
% The GUI is no longer waiting, just close it
delete(hObject);
end
|
  • print

댓글

댓글을 남기려면 링크 를 클릭하여 MathWorks 계정에 로그인하거나 계정을 새로 만드십시오.