Main Content


Check if object has diagram

Since R2020b



tf = slreportgen.utils.hasDiagram(obj) returns 1 (true) if the input object has a diagram and 0 (false) if the object does not have a diagram.

These types of objects have diagrams:

  • Simulink® block diagram

  • Simulink graphical subsystem

  • Stateflow® chart

  • Stateflow Simulink function

  • Subcharted Stateflow state

  • Subcharted Stateflow function

  • Subcharted Stateflow box

You can use this function to check if an object has a diagram before you try to use the object with an reporter.


collapse all

tf = slreportgen.utils.hasDiagram('f14/Aircraft Dynamics Model')
tf =



Input Arguments

collapse all

Object to check for a diagram, specified as a character vector or string scalar that contains the Simulink path of the object or as a handle to the object.

Output Arguments

collapse all

Whether the input object has a diagram, returned as 1 (true) if the input object has a diagram or 0 (false) if the input object does not have a diagram.

Version History

Introduced in R2020b