Main Content

setColWidth

Specify column widths for table in Model Advisor analysis results

    Description

    setColWidth(tableObj,column,relativeWidth) specifies the widths of columns for a table in Model Advisor results.

    example

    Examples

    collapse all

    Specify column widths for a table in your Model Advisor results by using setColWidth in a check callback function in your sl_customization file.

    Inside your check callback function, you can customize the check results to return a table. In this example, the first column of the table has the default width. The second column is twice as wide as the first column. The third column is three times as wide as the first column.

    % 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

    Input Arguments

    collapse all

    Table of Model Advisor results, specified as a ModelAdvisor.Table object.

    Column of the table, specified as an integer.

    Example: 2

    Relative width of column, specified as an integer.

    The column width is relative to the width of the entire table. For example, this code makes the second column twice as wide as the first column and the third column three times as wide as the first column:

    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
    By default, the columns in ModelAdvisor.Table have a relativeWidth of 1.

    Example: 3