1、matlab中有许多对话框的设置,这里介绍错误对话框,命令为为errordlg。
输入:
h = errordlg
出现如下对话框。


2、可以设置对话框的颜色和位置(大小):
set(h,'color','r');
set(h,'position',[311 200 400 200]);
set(h,'Units','Points');

3、这一对话框还有许多其他设置,可以在matlab中点击:
“Show all properties”看到其他设置:

4、我们进行一下其他设置:
mode = struct('WindowStyle','nonmodal','Interpreter','tex');
h = errordlg('Try this equation instead: f(x) = x^2','Equation Error', mode);
前面为对话框中显示的内容,后面是对话框名称。

5、Matlab中还有许多对话框,比如进度条、警告对话框、输入对话框等等。
这主要用于Matlab中GUI制作(guide)和function文件制作。
