Create input dialog box
Syntax
answer = inputdlg(prompt)
answer = inputdlg(prompt,title)
answer = inputdlg(prompt,title,lineNo)
answer = inputdlg(prompt,title,lineNo,defAns)
answer = inputdlg(prompt,title,lineNo,defAns,Resize)
Description
answer = inputdlg(prompt)
creates a modal dialog box and returns user inputs in the cell array. prompt
is a cell array containing prompt strings.
answer = inputdlg(prompt,title)
title
specifies a title for the dialog box.
answer = inputdlg(prompt,title,lineNo)
lineNo
specifies the number of lines for each user entered value. lineNo
can be a scalar, column vector, or matrix.
answer = inputdlg(prompt,title,lineNo,defAns)
defAns
specifies the default value to display for each prompt. defAns
must contain the same number of elements as prompt
and all elements must be strings.
answer = inputdlg(prompt,title,lineNo,defAns,Resize)
Resize
specifies whether or not the dialog box can be resized. Permissible values are 'on'
and 'off'
where 'on'
means that the dialog box can be resized and that the dialog box is not modal.
Example
Create a dialog box to input an integer and colormap name. Allow one line for each value.
prompt = {'Enter matrix size:','Enter colormap name:'};
title = 'Input for peaks function';
lines= 1;
def = {'20','hsv'};
answer = inputdlg(prompt,title,lines,def);
See Also
textwrap
, dialog
, warndlg
, helpdlg
, questdlg
, errordlg
[ Previous | Help Desk | Next ]