ModelAdvisor.Check.setCallbackFcn
R2026bSpecify callback function for check
Description
Examples
This example shows how to define a check using a callback
function whose style is defined as DetailStyle.
Create and configure Model Advisor check object.
function defineModelAdvisorChecks mdladvRoot = ModelAdvisor.Root; rec = ModelAdvisor.Check('com.mathworks.sample.Check0'); rec.Title = 'Check whether block names appear below blocks (recommended check style)'; rec.TitleTips = 'Example new style callback (recommended check style)'; rec.setCallbackFcn(@SampleNewCheckStyleCallback,'None','DetailStyle');
Create and assign an action object.
myAction0 = ModelAdvisor.Action; myAction0.setCallbackFcn(@sampleActionCB0); myAction0.Name='Make block names appear below blocks'; myAction0.Description='Click the button to place block names below blocks'; rec.setAction(myAction0);
Publish the check.
mdladvRoot.publish(rec, 'Demo');Input Arguments
Model Advisor check object, specified as a ModelAdvisor.Check object.
Specifies the callback function to execute when the check runs.
Example: @SampleNewCheckStyleCallback
Specifies when the callback function should be executed during the model checking process.
context Value | Definition |
|---|---|
'None' | Does not require any special context for compilation. |
'PostCompile' | Requires the model to be compiled. |
'PostCompileForCodegen' | Requires the model to be compiled for code generation
without simulation. Use this option to check if the
model is ready for code generation and to analyze both
active and inactive variant paths. To analyze all
variant paths, set the System target file configuration
parameter to ert.tlc. |
Example: 'PostCompile'
Specifies the style of the callback function to determine how the check's results are displayed in the Model Advisor.
style Value | Definition |
|---|---|
'StyleOne' | Uses a simple check callback function with results formatted using a template. |
'StyleTwo' | Uses a detailed check callback function for more comprehensive result reporting. |
'StyleThree' | Uses a check callback function that includes hyperlinked results for easier navigation. |
'DetailStyle' | Uses a callback function designed for result collections. This style is recommended for creating custom Model Advisor checks. |
Example: 'StyleTwo'
Version History
Introduced in R2008a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)