How to Add selected values of Listbox in MATLAB GUI?
Ältere Kommentare anzeigen
function listbox1_Callback(hObject, eventdata, handles)
contents= cellstr(get(hObject,'String'));
listchoice=contents(get(hObject,'Value'));
if(strcmp(listchoice,'a'))
lis1=10;
elseif(strcmp(listchoice,'b'))
lis1=20;
elseif(strcmp(listchoice,'c'))
lis1=30;
elseif(strcmp(listchoice,'d'))
lis1=40;
elseif(strcmp(listchoice,'e'))
lis1=50;
end
assignin('base','lis1',lis1);
i have created a listbox with five options with their respected values and when i select more than 1 option , I want the result to be added in the respective listbox.
6 Kommentare
Ankit
am 18 Sep. 2019
what do you mean by result to be added in the respective listbox?
You mean transfer selected options (more than 1) to another listbox?
ANURAG DEEPAK
am 18 Sep. 2019
Ankit
am 19 Sep. 2019
your listbox1_Callback returns single value according to your code.
ANURAG DEEPAK
am 19 Sep. 2019
Ankit
am 19 Sep. 2019
ANURAG DEEPAK
am 19 Sep. 2019
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu App Building finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!