Hauptinhalt

setBold

Set text as bold in Model Advisor analysis results

Description

setBold(textObj,boldText) sets the text in textObj to bold if boldText is true and removes bold formatting if boldText is false.

Note

The setBold function formats Model Advisor analysis results with Simulink® Check™. For more information, see Simulink Check.

For information on how to format text in MATLAB®, see Formatting Text.

example

Examples

collapse all

Create a Model Advisor text object with a message.

t1 = ModelAdvisor.Text("This is a message in bold.");

Set the text to bold.

setBold(t1,true);

Display the result (In actual usage, this object would be returned by a check callback):

disp("A ModelAdvisor.Text object has been created with bold formatting.");
A ModelAdvisor.Text object has been created with bold formatting.

You can also use this approach in a check callback function. Use setBold in a check callback function in your sl_customization file to format your Model Advisor results.

function result = SampleStyleOneCallback(system)
result = ModelAdvisor.Text("This is a message in bold.");
setBold(result,true);
end

Input Arguments

collapse all

Text for the Model Advisor output, returned as a ModelAdvisor.Text object.

Bold text setting, specified as a numeric or logical 1 (true) or 0 (false). If boldText is 1, then the text from textObj is displayed in bold. If boldText is 0, then the text is displayed in plain (non-bold) text.

Data Types: logical

Version History

Introduced in R2007b