How GUI popup menu List link with data

2 views (last 30 days)
SANGJUN PARK
SANGJUN PARK on 10 Sep 2015
Answered: Image Analyst on 10 Sep 2015
I have a Workspace names result.
there are names in first column -> result(:,1) after every Run, the order and list of result changed.
Then I want to make popmenu in GUI which is linked with first column of result.
How can I do?

Answers (1)

Image Analyst
Image Analyst on 10 Sep 2015
At the end of each "run" - when you have a new list in your cell array called "result" - do this
popupItems = result(:, 1); % Extract first column of cell array. It will be a list of strings.
set(handles.popup1, 'String', popupItems);
% Now select the first one, otherwise if the last time an item was selected that's longer than the list (like it was 30 but now the list is only 4 long), the popup will not be shown.
set(handles.popup1, 'Value', 1);

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!