LISTBOX, PLEASE HELP ME WITH THE LISTBOX
古いコメントを表示
Hello, i have posted some questions before about listbox but none give an answer....
my question is simple
i have this matrix:
a=1:1:10 % this is 1 2 3 4 5 6 7 8 9 10
i would like to load these numbers into a listbox, but i dont know how, must i change these numbers to char???
how ca i do this???? thanks in advance
1 件のコメント
evgeny shumsky
2019 年 9 月 10 日
編集済み: evgeny shumsky
2019 年 9 月 10 日
if you wont it to be one under another
Mat=[1:10];
Mat = mat2cell(num2str(Mat')); % mat=mat' converts from row vector to column vector
set(handles.listbox,'string',Mat); % listbox ->tag of the listbox

採用された回答
その他の回答 (1 件)
Wayne King
2013 年 8 月 27 日
a = inputdlg('Enter your vector');
% when dialog comes up enter, 1:10, click OK
a = str2num(cell2mat(a));
a is now a double precision vector
カテゴリ
ヘルプ センター および File Exchange で Interactive Control and Callbacks についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!