How to Add selected values of Listbox in MATLAB GUI?
Afficher commentaires plus anciens
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 commentaires
Ankit
le 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
le 18 Sep 2019
Ankit
le 19 Sep 2019
your listbox1_Callback returns single value according to your code.
ANURAG DEEPAK
le 19 Sep 2019
Ankit
le 19 Sep 2019
ANURAG DEEPAK
le 19 Sep 2019
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur App Building dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!