Main Content

simbio.diagram.splitBlock

Split SimBiology species block in diagram

Description

simbio.diagram.splitBlocksplits a species block so that each expression that references the species is connected to a different copy of the species block inSimBiology Model Builder。The changes are instantly reflected in the app.

Before you run the function at the command line:

  1. Open the corresponding SimBiology model in theSimBiology Model Builder应用程序。

  2. 将模型从应用程序导出到MATLAB®workspace by selectingExport>Export Model to MATLAB Workspaceon theHometab of the app.

You can query and configure only the properties of the objects shown in theDiagramtab 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.

example

expr.= simbio.diagram.splitBlock(speciesObj)makes copies of a SimBiology speciesspeciesObjblock so that each expression that referencesspeciesObjis connected to a different copy of the species block and returns a list of expression objectsexpr.that are connected tospeciesObj。使用此功能使图表看起来不那么杂乱和更清晰。

Examples

collapse all

Open thegproteinmodel in theSimBiology Model Builder应用程序。

simBiologyModelBuilder('gprotein');

The app opens and shows the model in theDiagramtab.

On theHometab of the app, selectExport>Export Model to MATLAB Workspace

In theSimBiology Model Exportdialog, click好的to export the model with the variable namem1

Go to the MATLAB command line and confirm that the modelm1is in the workspace. Get a list of species of the model.

m1.Species
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, callingsimbio.diagram.splitBlock不会再次拆分块,但返回物种连接的表达式列表。在这种情况下,Gbgis used in two reactions.

Gbg = m1.Species(7); expr = simbio.diagram.splitBlock(Gbg)
expr =血液生物反应阵列指数:反应:1 gd + gbg  - > g 2 g + Rl  - > Ga + Gbg + R1

Join all the cloned blocks so that there is only one block forGbg。在这种情况下,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 inexpr.可以换。

simbio.diagram.joinBlock(Gbg,expr(2))

Input Arguments

collapse all

Species object, specified as a SimBiologySpecies目的。speciesObjmust be scalar.

Output Arguments

collapse all

List of expressions that species is connected to, returned as aReaction,Ruleobject or array of objects. The rule object can be a rate rule or repeated assignment rule.

Version History

Introduced in R2021a