필터 지우기
필터 지우기

How to populate a listbox from a pop up menu

조회 수: 2 (최근 30일)
Chelsea
Chelsea 2012년 12월 5일
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??

답변 (1개)

Matt Fig
Matt Fig 2012년 12월 5일
Set the string property.
set(handles.listbox1, 'string','Restaurant')
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 12월 5일
set(handles.listbox1, 'string', {'Restaurant1', 'Restaurant2'})

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Language Fundamentals에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by