MATLAB: How to display cell contents in MATLAB GUI dropdown menu

cell arraysguiguidematlab gui

Hello Everyone,
I have a GUI in which I want to display the entries of a 1-by-n cell as text in a dropdown menu as available options to select from. For example
webcamlist
ans =
cell
'USB2.0 PC CAMERA'
>> cam = webcam();
>> cam.AvailableResolutions
ans =
1×5 cell array
'640x480' '352x288' '320x240' '176x144' '160x120'
Now what I want to do is to display the contents of ans as string in a dropdown list in GUI. Can you help me?

Best Answer

set(handles.TagOfYourDropdown, 'String', cam.AvailabelResolutions);
where handles.TagOfYourDropdown is the handle to your uicontrol('style', 'list')
Related Question