필터 지우기
필터 지우기

MATLAB GUI ---- HOW TO CODE FOR MULTIPLE LIST BOXES

조회 수: 3 (최근 30일)
Val
Val 2013년 9월 30일
답변: Jan 2013년 9월 30일
i have created four list boxes in my GUI.
Iam able to display the selected items from each list box.
But i dont know how to code for further calculations using these selected items from the list boxes.
Can anyone give me one example on this.
I searched a lot. but i am getting example for single list box.
Not getting any examples that, how to code for more than one list box.
if u have any link regarding this, pls answer me.
  댓글 수: 1
Jan
Jan 2013년 9월 30일
What is the relation to the tag "matlab code"? I've deleted the other tags, because all questions in this forum concern "matlab".

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

답변 (1개)

Jan
Jan 2013년 9월 30일
It is not easy to answer, because accessing 4 listboxes works exactly as accessing 1 of them only. Therefore it is hard to guess, which troubles you have.
A bold guess is this callback of a button, which starts the calculations:
function ButtonCallback(ObjectH, EventData, handles)
Selected = cell(1, 4);
Value1 = get(handles.listbox1, 'Value');
String1 = get(handles.listbox1, 'String');
Selected{1} = String1{Value1}; % Assuming a single selection box
Value2 = get(handles.listbox2, 'Value');
String2 = get(handles.listbox2, 'String');
Selected{2} = String2{Value1}; % Assuming a single selection box
... etc
disp(Selected)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by