필터 지우기
필터 지우기

How to properly get the popupmenu control value

조회 수: 1 (최근 30일)
Guillaume A.
Guillaume A. 2012년 7월 13일
Hi, I've got an issue with the popupmenu control. I'm try to get the string of the currently selectionned item. As documented here (<http://www.mathworks.com/help/techdoc/creating_guis/f4-998395.html>) I simply code this :
list = get(source, 'String');
val = get(source,'Value');
str = list{val};
but I get this error :
??? Cell contents reference from a non-cell array object.
What am I doing wrong with this simple code ??

채택된 답변

Guillaume A.
Guillaume A. 2012년 7월 13일
Ok, list is a char array so I needed to convert it to a string list :
listStr = cellstr(list);
str = listStr{val};

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by