You are on page 1of 2

MATLAB inputdlg

inputdlg

answer = inputdlg(prompt)
prompt cell array
egprompt = {'Enter matrix size:','Enter colormap name:'};
answer cell array
eganswer = {'1','2'};
answer = inputdlg(prompt,dlg_title)
dlg_title
answer = inputdlg(prompt,dlg_title,num_lines)
num_lines
answer = inputdlg(prompt,dlg_title,num_lines,defAns)
defAns cell
egdefAns = {'20','hsv'};
answer = inputdlg(prompt,dlg_title,num_lines,defAns,options)
options
options on'
options
Resize Can be 'on' or 'off' (default). If 'on', the window is resizable
horizontally.
WindowStyleCan be either 'normal' or 'modal' (
).
Interpreter Can be either 'none' (default) or 'tex'. If the value is 'tex', the
prompt strings are rendered using LaTeX.

Matlab str2double
str2double
str2double str2num matlab
doc str2double help str2double

X = str2double('str')
str ASCII str
1,000 str
NaN
X = str2double(C)
C C
char, hex2num, num2str, str2num

>> str = '1,000,123';


>> a = str2double(str)
a = 1000123
>> str2 = '1.2345e5';
>> b = str2double(str2)
b = 123450
>> str3 = '1 + 2i';
>> c = str2double(str3)
c = 1.0000 + 2.0000i
>> str4 = '1.2345 6'; % 5
>> d = str2double(str4)
d = NaN
>> my_cell{1} = 'Hello';
>> my_cell{2} = '10';
>> e = str2double(my_cell)
e = NaN 10

You might also like