Main Content

setEntry

Specify content cell in table

    Description

    setEntry(tableObj,row,column,cellEntry) adds the content specified by cellEntry to the cell in row, row, and column, column, in the Model Advisor table object, tableObj.

    Note

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

    For information on how to set cell contents in MATLAB®, see Create Tables and Assign Data to Them.

    example

    Examples

    collapse all

    This example shows how to create two Model Advisor table objects, table1 and table2, and insert table2 into the first cell of table1.

    Use ModelAdvisor.Table to create two Model Advisor table objects.

    table2 = ModelAdvisor.Table(1,1);
    table2 = ModelAdvisor.Table(2,3);

    Add table2 to the cell in the first row and first column of the Model Advisor table object table1.

    setEntry(table1,1,1,table2);

    Use setEntry in a check callback function in your sl_customization file to set table cell content in your Model Advisor results.

    function result = SampleStyleOneCallback(system)
    table1 = ModelAdvisor.Table(1,1);
    table2 = ModelAdvisor.Table(2,3);
    setEntry(table1,1,1,table2);
    result = table1;
    end

    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

    Table cell content, specified as a character vector, ModelAdvisor.Element object, or ModelAdvisor.Element object array.

    Version History

    Introduced in R2006b