Main Content

slreportgen.utils.getModelHandle

Get handle to Simulink model that contains block or Stateflow chart

Description

modelHandle = slreportgen.utils.getModelHandle(obj) returns the handle of the Simulink® model that contains obj.

example

Examples

collapse all

Open the model f14.

openExample("f14");

Specify the path to the Controller block.

block_path = "f14/Controller";

Get the handle to the model that contains the block.

model_handle = slreportgen.utils.getModelHandle(block_path);

Open the model sf_car.

openExample("sf_car");

Find the Stateflow.Chart object for the shift_logic chart.

chart = find(sfroot,"-isa","Stateflow.Chart",Name="shift_logic");

Get the handle to the model that contains the chart.

model_handle = slreportgen.utils.getModelHandle(chart);

Input Arguments

collapse all

Simulink block path or Stateflow object, specified as:

  • A string or character vector that contains the object path.

  • A numeric block handle.

  • A Stateflow API object, such as Stateflow.Chart or Stateflow.State. For more information about Stateflow API objects, see Summary of Stateflow API Objects and Properties (Stateflow).

Output Arguments

collapse all

Model handle, returned as a double.

Version History

Introduced in R2018b