Get string from popupmenu

조회 수: 18 (최근 30일)
Ahmed Alshehhi
Ahmed Alshehhi 2018년 4월 3일
답변: Image Analyst 2018년 4월 3일
I want to get string from popupmenu and use it as string in another function

채택된 답변

Image Analyst
Image Analyst 2018년 4월 3일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 App Building에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by