Main Content

setEntryAlign

Specify horizontal alignment for cell content

    Description

    setEntryAlign(tableObj,row,column,alignment) sets the horizontal alignment of the cell in the row, row, and column, column, in the Model Advisor table object, tableObj, to the alignment specified by alignment.

    Note

    The function setEntryAlign is for formatting tables in Model Advisor analysis results with Simulink® Check™. For more information, see Simulink Check.

    For information on how to use tables in MATLAB®, see Create Tables and Assign Data to Them.

    example

    Examples

    collapse all

    This example shows how to create a Model Advisor table object, add content to a cell, and set the cell text alignment.

    Use ModelAdvisor.Table to create a Model Advisor table object with two rows and three columns.

    table1 = ModelAdvisor.Table(2,3);
    

    Add a title to the table.

    setHeading(table1,'Title of New Table');

    Add the text 'First Entry' to the cell in the first row and first column of the Model Advisor table object table1.

    setEntry(table1,1,1,'First Entry');
    

    Center the content in the cell in the first row and first column of the Model Advisor table object.

    setEntryAlign(table1,1,1,'center');
    

    For more information on how to format check results, see Define Custom Model Advisor Checks.

    Input Arguments

    collapse all

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

    Number of rows to create in the Model Advisor results table, specified as an integer.

    Example: 5

    Data Types: int

    Number of columns to create in the Model Advisor results table, specified as an integer.

    Example: 2

    Data Types: int

    Horizontal cell alignment, specified as left, center, or right.

    alignmentDefinition
    leftHorizontally align contents to the left edge of the cell.
    centerHorizontally center cell contents.
    rightHorizontally align contents to the right edge of the cell.

    Version History

    Introduced in R2006b