Filter löschen
Filter löschen

How to best to accept list input from a dialog box?

1 Ansicht (letzte 30 Tage)
Christopher
Christopher am 3 Feb. 2012
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/

Antworten (2)

Sean de Wolski
Sean de Wolski am 3 Feb. 2012
uicontrol('style','list','string',cellfun(@num2str,num2cell(1:10)','uni',false))

Walter Roberson
Walter Roberson am 3 Feb. 2012
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.

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by