FUNCTION REFERENCE

inputdlg

Ask for one or more lines of text in a dialog.

Ask for one or more lines of text in a dialog.

Syntax

answer = inputdlg(prompt, title, dims, definput)

prompt is a character vector or a cell array with one prompt per field. dims sets the number of text lines: a scalar for every field, one row per field, or [lines width] rows (width is ignored). definput is a cell array with one default answer per field. answer is a cell column of character vectors, in prompt order; a field with more than one line answers a char matrix with one padded row per line. On Cancel answer is an empty cell {}. Enter in a one-line field is OK; Escape is Cancel. Needs the desktop app.

Example

a = inputdlg({'Rows:', 'Columns:'}, 'Size', 1, {'3', '4'}); n = str2double(a);

Differences from MATLAB: The options argument (Resize, WindowStyle, Interpreter) is accepted and ignored.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.