User`s guide

25 Create Model Advisor Checks
25-46
Bold title, row, and column headings
Change table formatting using the ModelAdvisor.Table constructor.
The following example code creates a subtable within a table.
table1 = ModelAdvisor.Table(1,1);
table2 = ModelAdvisor.Table(2,3);
table2.setHeading('Table 2');
table2.setHeadingAlign('center');
table2.setColHeading(1, 'Header 1');
table2.setColHeading(2, 'Header 2');
table2.setColHeading(3, 'Header 3');
table1.setHeading('Table 1');
table1.setEntry(1,1,table2);
The following example code creates a table with five rows and five columns containing
randomly generated numbers. Use the MATLAB code in a callback function to create the
table. The Model Advisor displays table1 in the results.
% ModelAdvisor.Table example
matrixData = rand(5,5) * 10^5;
% initialize a table with 5 rows and 5 columns (heading rows not counting)
table1 = ModelAdvisor.Table(5,5);
% set column headings
for n=1:5
table1.setColHeading(n, ['Column ', num2str(n)]);
end
% set alignment of second column heading
table1.setColHeadingAlign(2, 'center');
% set column width of second column
table1.setColWidth(2, 3);
% set row headings
for n=1:5