Split SimBiology species block in diagram
makes copies of a SimBiology species
expr = simbio.diagram.splitBlock(
speciesObj block so that each
expression that references
speciesObj is connected to a different copy
of the species block and returns a list of expression objects
are connected to
speciesObj. Use this function to make the diagram look
less cluttered and clearer.
Before you run the function at the command line:
Open the corresponding SimBiology model in the SimBiology Model Builder app.
Export the model from the app to the MATLAB® workspace by selecting Export > Export Model to MATLAB Workspace on the Home tab of the app.
You can query and configure only the properties of the objects shown in the Diagram tab of the app. The objects shown in the diagram are compartments, species, reactions, rate rules, repeated assignment rules, and parameters that are on the left-hand side of a rate rule, a repeated assignment rule, or an event function.
Create Copies of Species Block
gprotein model in the SimBiology Model
The app opens and shows the model in the Diagram tab.
On the Home tab of the app, select Export > Export Model to MATLAB Workspace.
In the SimBiology Model Export dialog, click OK to export the model with the variable name m1.
Go to the MATLAB command line and confirm that the model m1 is in the workspace. Get a list of species of the model.
ans = SimBiology Species Array Index: Compartment: Name: Value: Units: 1 unnamed G 7000 2 unnamed Gd 3000 3 unnamed Ga 0 4 unnamed RL 0 5 unnamed L 6.022e+17 6 unnamed R 10000 7 unnamed Gbg 3000
The model diagram already has a copy for each expression that the species Gbg is
being referenced. In this case, calling
does not split the block again, but returns the list of expressions that the species is
connected to. In this case,
Gbg is used in two reactions.
Gbg = m1.Species(7); expr = simbio.diagram.splitBlock(Gbg)
expr = SimBiology Reaction Array Index: Reaction: 1 Gd + Gbg -> G 2 G + RL -> Ga + Gbg + RL
Join all the cloned blocks so that there is only one block for
Gbg. In this case, keep the copy of the block that is connected to
the G Protein activation reaction (
G + RL -> Ga + Gbg + RL). Note
that the order of reactions returned in
expr can change.