How to get an output data from a GUI popup menu to use as data in .m file.

6 views (last 30 days)
From the popupmenu created in GUIDE, I want to get the data choosen by the user for Month and feeder and use it as an input data to my separate .m file.
  6 Comments
Walter Roberson
Walter Roberson on 19 Aug 2019
month_names = get(handles.popmonth, 'string');
choice_string = month_names{get(handles.popmonth, 'value')};
Adam
Adam on 19 Aug 2019
Simplest option is to call your script (which ideally should be a function) from inside the popup menu's callback.
If you want the popup menu GUI to close after selection and then use the result you will need to use
doc uiwait
with a matched uiresume and assign your popup menu results to the handles.output that you return (or you can return anything from handles if you change the line in the OutputFcn to have different or more varargout arguments).

Sign in to comment.

Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!