How to Add selected values of Listbox in MATLAB GUI?
古いコメントを表示
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 件のコメント
Ankit
2019 年 9 月 18 日
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
2019 年 9 月 18 日
Ankit
2019 年 9 月 19 日
your listbox1_Callback returns single value according to your code.
ANURAG DEEPAK
2019 年 9 月 19 日
Ankit
2019 年 9 月 19 日
ANURAG DEEPAK
2019 年 9 月 19 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で App Building についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!