Open the ex_sldemo_hydcyl
model.
In the Diagnostics pane of Model Configuration
Parameters, set Algebraic loop to
none
or warning
. Setting this
parameter to error
prevents the model from compiling.
Compile the model without any errors. The model must compile before you can
highlight any algebraic loops.
At the MATLAB command prompt, enter:
AlgebraicLoop with properties:
Model: [1×1 Simulink.BlockDiagram]
Id: [0 1]
VariableBlockHandles: [198.0001 145.0001]
BlockHandles: [9×1 double]
IsArtificial: 0
The resulting output shows that the model has one algebraic loop, which contains
three blocks.
Running the getAlgebraicLoops
function also opens the Algebraic
Loop viewer. Use the Algebraic loop viewer to highlight specific algebraic loops in your
model or all the loops.
The selected loops are highlighted in the corresponding model, in.