Matlab learning ------------ normal dialog box, error dialog box errordlg, warning dialog box warndlg

Source: Internet
Author: User

Dialog dialog box

Syntax:

H = Dialog ('propertyname', propertyvalue ,...)

Default properties of the dialog box


Windowstyle value: {normal} | modal | docked

Detailed instance:

Out = dialog; % after the default dialog box is displayed, click the blank dialog box in the dialog box to close it.

Result:


% Normal dialog box

Out = Dialog ('windowstyle', 'normal ',...

'Name', 'My dialog dialogs ',...

'Position', [300 300 400 300]);

Uicontrol ('parent', out ,...

'Style', 'pushutton ',...

'Position', [80 40 80 50],...

'String', 'OK ',...

'Callback', 'delete (gcb') '); % callback function, click the button to close the dialog box

Result: (click the button to close the dialog box)


Error dialog box errordlg

Syntax:

H = errordlg

H = errordlg (errorstring)

H = errordlg (errorstring, dlgname)

H = errordlg (errorstring, dlgname, createmode)

% Createmode value: Non-modal (default), modal, replace

Example:

H = errordlg ('Dialog box content', 'Dialog box title', 'modal ')


Warndlg warning dialog box (similar to the error dialog box)

Syntax:

H = warndlg

H = warndlg (warningstring)

H = warndlg (warningstring, dlgname)

H = warndlg (warningstring, dlgname, createmode)

Example:

Warndlg ('pressing OK will clear memory ','!! Warning !! ')

Result:






Matlab learning ------------ normal dialog box, error dialog box errordlg, warning dialog box warndlg

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.