Main Content

slreportgen.utils.getModelHandle

Get Simulink model

Description

example

modelHandle = slreportgen.utils.getModelHandle(obj) returns the handle of a Simulink® model or Stateflow® object.

Examples

Obtain Simulink Model Handle

openExample('f14') 
modelHandle_blk = slreportgen.utils.getModelHandle('f14/Controller')
modelHandle_blk =

    2.0002

Obtain Stateflow Chart Handle

load_system("sf_car");
chart = find(slroot,"-isa","Stateflow.Chart", ...
    Name="shift_logic");
chart_handle = slreportgen.utils.getModelHandle(chart);

Input Arguments

collapse all

Simulink or Stateflow object, specified as a string or character array of the object path or object handle. This utility returns the handle of the specified model or chart. If you specify an element in the model or chart, this utility returns the handle of the containing model or chart.

Output Arguments

collapse all

Model handle, returned as a double.

Version History

Introduced in R2018b