How to best to accept list input from a dialog box?
1 次查看(过去 30 天)
显示 更早的评论
I have a project in which I would like to have the user input a list of numbers that represents column numbers of a cell array by using a dialog box, e.g. similiar to warndlg/
0 个评论
回答(2 个)
Sean de Wolski
2012-2-3
uicontrol('style','list','string',cellfun(@num2str,num2cell(1:10)','uni',false))
0 个评论
Walter Roberson
2012-2-3
inputdlg() accepts any string, including strings that contain commas or spaces. You can use str2num() or str2double() to convert the string representations in to numeric values.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!