How to get an output data from a GUI popup menu to use as data in .m file.
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
Walter Roberson
2019-8-19
month_names = get(handles.popmonth, 'string');
choice_string = month_names{get(handles.popmonth, 'value')};
Adam
2019-8-19
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).
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!