Show algebraic loop



ashow returns a list of algebraic loops in the current model.


Simulink® Debugger must be active (started) for all the debugger commands to run.


ashow gcb returns the algebraic loop containing the currently selected block.

ashow s:b returns the algebraic loop containing block b in system s

ashow s#n returns the nth algebraic loop in the system s

ashow clear removes algebraic loop highlighting in the current model


collapse all

This example shows you how to find algebraic loops and step through a simulation

Open the sldemo_hydcyl model

Start the Simulink debugger. Select Simulation > Debug > Debug Model.

Run the debugger.

In the MATLAB® command prompt, enter:

Found 1 Algebraic loop(s): 
System number#Algebraic loop id, number of blocks in loop
- 0#1, 9 blocks in loop

The command returns the algebraic loops in the model as well as the number of blocks contained within.

Open the sldemo_hydcyl model and start the Simulink debugger.

Select any nonvirtual block in the model. For more information, see Nonvirtual and Virtual Blocks.

For example, select the PlotResults block, which is a Scope block.

In the MATLAB command prompt, enter

ashow gcb
Block sldemo_hydcyl/PlotResults isn't in an algebraic loop.

The PlotResults block does not belong in any algebraic loop.

Look under the mask of the Valve/Cylinder/Piston/Spring Assembly subsystem. To look under the mask, right click on the subsystem and open the context menu. Select Mask > Look Under Mask. Alternately, select the subsystem and press Ctrl+U.

Select the laminar flow pressure drop block.

In the MATLAB command prompt, enter

ashow gcb
- sldemo_hydcyl/Valve//Cylinder//Piston//Spring Assembly/Control Valve Flow/IC
- sldemo_hydcyl/Valve//Cylinder//Piston//Spring Assembly/Control Valve Flow/signed sqrt
- sldemo_hydcyl/Valve//Cylinder//Piston//Spring Assembly/Control Valve Flow/Product
- sldemo_hydcyl/Valve//Cylinder//Piston//Spring Assembly/laminar flow pressure drop
- sldemo_hydcyl/Valve//Cylinder//Piston//Spring Assembly/Sum7
- sldemo_hydcyl/Pump/IC
- sldemo_hydcyl/Valve//Cylinder//Piston//Spring Assembly/Control Valve Flow/Sum1 (algebraic variable)
- sldemo_hydcyl/Pump/Sum1
- sldemo_hydcyl/Pump/leakage (algebraic variable)

The laminar flow pressure drop block is contained in an algebraic loop with 8 other blocks.

Input Arguments

collapse all

Currently selected block, specified as gcb.

Example: ashow gcb

Block index in the model, specified as system index:block index.

Example: ashow 1:1

Data Types: double

Algebraic loop index, specified as system index#loop index

Example: ashow 0#1

Data Types: double

Remove algebraic loop highlighting from model.

Introduced before R2006a