inputdlg
创建并打开输入对话框。
语法:answer = inputdlg(prompt)
prompt 包含对话框中输入框之上的提示台词的cell array。
eg:prompt = {'Enter matrix size:','Enter colormap name:'};
answer 返回包含每个输入框的结果的一个cell array。
eg:answer = {'1','2'};
answer = inputdlg(prompt,dlg_title)
dlg_title 对话框的标题。
answer = inputdlg(prompt,dlg_title,num_lines)
num_lines 对话框中输入框的行数。
answer = inputdlg(prompt,dlg_title,num_lines,defAns)
defAns 对话框中默认显示的数据,cell 类型。
eg:defAns = {'20','hsv'};
answer = inputdlg(prompt,dlg_title,num_lines,defAns,options)
options 对话框的一些属性的设置,包括:
如果options是一个字符串‘on',那对话框横向的大小可变。
如果options是一个结构体,那么此结构体包含以下三个域:
Resize:Can be 'on' or 'off' (default). If 'on', the window is resizable horizontally.
WindowStyle:Can be either 'normal' or 'modal' (默认值,模式对话框,禁止其他输入).
Interpreter:Can be either 'none' (default) or 'tex'. If the value is 'tex', the prompt strings are rendered using LaTeX.
本文介绍了MATLAB中用于创建输入对话框的inputdlg函数,包括其基本语法、参数用法和示例。通过示例展示了如何设置对话框提示台词、标题、默认输入值以及对话框的属性,帮助用户更好地理解和应用inputdlg函数。

3895

被折叠的 条评论
为什么被折叠?



