Contenido principal

setColTitles

Add column titles to table in Model Advisor analysis results

Description

setColTitles(ftObj,colTitles) sets the column titles in the table specified by Model Advisor formatting object ftObj to the title text specified by colTitles. If you do not add data to a table, Model Advisor does not display the table in the results.

Note

Before adding data to a table, you must specify column titles using the setColTitles method.

The function setColTitles 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 template object and specify column titles.

Create a formatting template object.

ft = ModelAdvisor.FormatTemplate("TableTemplate");

Set the column titles for the table. For example, use 'Index' for the first column and 'Block Name' for the second column.

setColTitles(ft,{"Index","Block Name"});

You can include this logic in a Model Advisor check callback function, such as in your sl_customization file:

function result = SampleStyleOneCallback(system)
ft = ModelAdvisor.FormatTemplate("TableTemplate");
setTableTitle(ft,{"Blocks in Model"});
setColTitles(ft,{"Index","Block Name"});
setTableInfo(ft,{"1","Gain"});
result = ft;
end

Input Arguments

collapse all

ModelAdvisor.FormatTemplate object, specified as a handle to the formatting template.

Table column titles, specified as either a cell array of character vectors or a handle to a valid formatting template object. The order of the items in the cell array determines which column the item is in.

Example: {"Index","Block Name"}

Version History

Introduced in R2009a