필터 지우기
필터 지우기

help me How to get the string from popup menu in matlab GUI ?

조회 수: 8 (최근 30일)
Nguyen Trong Nhan
Nguyen Trong Nhan 2013년 12월 23일
답변: Image Analyst 2013년 12월 23일
Could you help me how to get the string in matlab GUI. I wrote : get(handles.popupmenu1,'string'). but it's error and can't get the string from popup menu. thanks you very much.

채택된 답변

Image Analyst
Image Analyst 2013년 12월 23일
That should give you a list of all the items in the popup. I'm surprised it gives you an error. Even if it's empty I would think it would return null, []. What does the error message say exactly?
Normally you'd do something like
allItems = get(handles.popupmenu1,'string')
selectedIndex = get(handles.popupmenu1,'Value')
selectedItem = allItems{selectedIndex};

추가 답변 (0개)

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by