How to display cell contents in MATLAB GUI dropdown menu?

1 visualización (últimos 30 días)
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?

Respuesta aceptada

Walter Roberson
Walter Roberson el 27 de En. de 2019
set(handles.TagOfYourDropdown, 'String', cam.AvailabelResolutions);
where handles.TagOfYourDropdown is the handle to your uicontrol('style', 'list')

Más respuestas (0)

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by