Clear Filters
Clear Filters

How to properly get the popupmenu control value

1 view (last 30 days)
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 ??

Accepted Answer

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

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!