Filter löschen
Filter löschen

Get string from popupmenu

7 Ansichten (letzte 30 Tage)
Ahmed Alshehhi
Ahmed Alshehhi am 3 Apr. 2018
Beantwortet: Image Analyst am 3 Apr. 2018
I want to get string from popupmenu and use it as string in another function

Akzeptierte Antwort

Image Analyst
Image Analyst am 3 Apr. 2018
Try this:
allItems = handles.popupname.String; % A cell array of all strings in the popup.
selectedIndex = handles.popupname.Value; % An integer saying which item has been selected.
selectedItem = allItems{selectedIndex}; % The one, single string which was selected.
YourOtherFunction(selectedItem); % Pass the string to some other function of yours.

Weitere Antworten (0)

Kategorien

Mehr zu App Building finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by