This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

helpdlg

Create help dialog box

Syntax

helpdlg
helpdlg(msg)
helpdlg(msg,title)
f = helpdlg(___)

Description

helpdlg creates a nonmodal Help dialog box with the default title, Help Dialog, and the default message, This is the default help.

example

helpdlg(msg) specifies custom message text. If a dialog box with a matching dialog box title already exists, then MATLAB® brings it to the front.

example

helpdlg(msg,title) specifies a custom title for the dialog box.

f = helpdlg(___) returns the figure object. You can use this syntax with any of the input arguments from the previous syntaxes.

Examples

Specify Custom Message

helpdlg('Consider using a cell array.');

Specify Message with Line Breaks

Specify the help dialog box text using a cell array of character vectors. Line breaks occur after each array element.

helpdlg({'Valid data types are:','int8',...
         'int16','int32','int64'});

Specify Custom Title and Message

Create a dialog box with a custom title and message.

helpdlg('Choose 10 points from the figure',...
        'Point Selection');

If the dialog box is not visible, it might be buried under other windows. Issue the command again to bring it to the front

helpdlg('Choose 10 points from the figure',...
        'Point Selection');

Now, change the message by calling helpdlg again using the same title with a different message.

helpdlg('Choose 5 points from the figure',...
        'Point Selection')

After you create a dialog box, each time you call helpdlg and specify the same title, MATLAB brings that dialog box to the front. If the dialog box title is unchanged, then MATLAB only creates a new dialog box if you close the dialog box between calls to helpdlg.

Input Arguments

collapse all

Help message, specified as a character vector, cell array of character vectors, or string array.

  • If you specify the help message as a character vector, then a long message wraps to fit the dialog box.

  • If you specify the help message as a cell array of character vectors, then lines breaks occur between each array element. Long elements wrap to fit the dialog box.

Example: 'This value is required.'

Example: {'Valid data types are:','int8','int16','int32','int64'}

Dialog box title, specified as a character vector or a string array.

Example: 'Value Specification'

More About

collapse all

Nonmodal Dialog Box

A nonmodal dialog box does not prevent the user to interact with other MATLAB windows before responding.

Tips

  • MATLAB program execution continues even when a modal Help dialog box is active. To block program execution until the user closes the dialog box, use the uiwait function.

Introduced before R2006a