This function is an enhanced version of the standard INPUTDLG function with many additional features:
- 8 control types: text, edit, check, list, range, color, table, button
(**color, table, and button were added in v2.0**)
- Text Type is a static text (e.g., to place an instruction)
- Check Type displays a checkbox with a label, returns one of two values. Value could be logical, integer, or string
- Edit Type can be configured to accept:
* plain text (single- or multi-line mode)
* date (following date formats as defined in DATESTR)
* numeric value (integer or float with attribute specification)
* file or directory name (with UIGETFILE, UIPUTFILE, or UIGETDIR functions, supports UIGETFILE multi-sel
* vector (can specify the length of the vector or the attributes of its elements if the length is fixed or arbitrary). To specify a row vector, include the 'row' keyword in formats.limits field.
- List Type returns index(es) of the selected item and can have 4 different appearances:
* Listbox (can be made to multi-select)
* Radiobutton (button placements can be customized)
* Togglebutton (button placements can be customized)
- INPUTSDLG can automatically size controls and dialog box for an optimal appearance, and control's size can be made to auto-adjust if dialog is made resizable.
- INPUTSDLG supports user callbacks to all UI controls as well as dialog's CreateFcn and DeleteFcn callbacks. The callback function takes additional input arguments to standard MATLAB callback arguments.
- INPUTSDLG returns the user entries in a cell or in a structure
- INPUTSDLG is backward compatible with INPUTDLG except for its returned values when canceled. With default answers given, INPUTDLG returns an empty cell while INPUTSDLG returns the default answers. INPUTSDLG returns the second parameter, CANCELED(a logical flag) to indicate how the dialog box is terminated.
- Luke Reisner prepared v1.3 and kindly shared his modification/bug fixes.
- Florian Hatz initiated the development of v2.0 with his ideas of adding table, color, and tiling option
Kesh Ikuma (2023). inputsdlg: Enhanced Input Dialog Box (https://www.mathworks.com/matlabcentral/fileexchange/25862-inputsdlg-enhanced-input-dialog-box), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Bug fix on list control's default value processing
Bug fixes in default value processing
- Allows a row vector with edit:vector format.
* Added support for 'text' format with 'check' type
bug fix & extended compatibility to pre-R2011b
v2.1b - same day bug fixes #2
v2.1a (same day bug fixes)
v.2.1.0 (Jul 03, 2014)
v2.0.6 - bug fixes
* Improved error message on FORMATS-PROMPT size mismatch.
Bug fix: parsing empty callback format field (Thanks David!)
v2.0.3: bug fix release
Made compatible with pre-R2013a releases
Bug fix release
v.2.0 (T. Ikuma & F. Hatz)
v1.3 (by Luke Reisner)
v.1.2.2 (July 15, 2010)
Bug Fix: Default Options bug reported by Jason
* Fixed a couple bugs
(v.1.12) More bug fixes
v1.1 (Nov. 19, 2009)