matlab 对话框弹出

msgbox('你要显示的内容', '对话框标题');

msgbox(num2str(p), '对话框标题');

matlab中inputdlg函数用户交互中使用方法如下:

answer = inputdlg(prompt,dlg_title,num_lines,defAns,options)

prompt:输入文本框的标签

dlg_title:对话框的标题

num_lines:输入文本框的行数

defAns:默认的文本框内容

options:一些可选的对话框选项

prompt={'Enter the matrix size for x^2:',...

'Enter the colormap name:'};

name='Input for Peaks function';

numlines=1;

defaultanswer={'20','hsv'};

options.Resize='on';

options.Window;

options.Interpreter='tex';

answer=inputdlg(prompt,name,numlines,defaultanswer,options);

返回结果为字符串。