setColWidth
为模型顾问分析结果中的表指定列宽
说明
setColWidth(
指定模型顾问结果中表的列宽。tableObj
,column
,relativeWidth
)
示例
通过在 sl_customization
文件中的检查回调函数中使用 setColWidth
来指定模型顾问结果中表的列宽。
在检查回调函数中,您可以自定义检查结果,以返回一个表。在此示例中,表的第一列采用默认宽度。第二列的宽度是第一列的两倍。第三列的宽度是第一列的三倍。
% Create table for displaying results numRows = 1; numCols = 3; table = ModelAdvisor.Table(numRows,numCols); % Fill in table with example entries setEntry(table,1,1,'entry 1'); setEntry(table,1,2,'entry 2'); setEntry(table,1,3,'entry 3'); % Specify widths of columns in table setColWidth(table,1,1); % set column 1 to the default width setColWidth(table,2,2); % make column 2 twice as wide as column 1 setColWidth(table,3,3); % make column 3 three times as wide as column 1
输入参数
模型顾问结果的表,指定为 ModelAdvisor.Table
对象。
表的列,指定为整数。
示例: 2
列的相对宽度,指定为整数。
列宽是相对于整个表的宽度而言的。例如,以下代码使第二列的宽度是第一列的两倍,第三列的宽度是第一列的三倍:
setColWidth(table,1,1); % set column 1 to the default setColWidth(table,2,2); % make column 2 twice as wide as column 1 setColWidth(table,3,3); % make column 3 three times as wide as column 1
ModelAdvisor.Table
中列的 relativeWidth
为 1
。示例: 3
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)