How to populate a listbox from a pop up menu

1 visualización (últimos 30 días)
Chelsea
Chelsea el 5 de Dic. de 2012
I am creating a GUI and I have a pop up menu with strings in it like city names. I want a list of restaurant names to appear in my listbox I created when a city is selected from the pop up menu. I used
a=get(hObject,'value');
switch a
case 1
set (handles.listbox1, 'Restaurant','Restaurant')
but this isnt working. Any Advice??

Respuestas (1)

Matt Fig
Matt Fig el 5 de Dic. de 2012
Set the string property.
set(handles.listbox1, 'string','Restaurant')
  1 comentario
Walter Roberson
Walter Roberson el 5 de Dic. de 2012
set(handles.listbox1, 'string', {'Restaurant1', 'Restaurant2'})

Iniciar sesión para comentar.

Categorías

Más información sobre Language Fundamentals en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by