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.
Video Player is loading.
Current Time 0:00
Duration 3:39
Loaded: 4.55%
Stream Type LIVE
Remaining Time 3:39
 
1x
  • Chapters
  • descriptions off, selected
  • captions off, selected
  • en (Main), selected
    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

    Comments

    To leave a comment, please click here to sign in to your MathWorks Account or create a new one.

    Loading...
    Go to top of page