addreactant (reaction)
Add species object as reactant to reaction object
Syntax
speciesObj
=
addreactant(reactionObj
, 'NameValue
')
speciesObj
= addreactant(reactionObj
, speciesObj
)
speciesObj
= addreactant(reactionObj
, speciesObj
, StoichCoefficient
)
speciesObj
= addreactant(reactionObj
,
'NameValue
', StoichCoefficient
)
Arguments
reactionObj | Reaction object. |
NameValue | Names of species objects. Enter a character vector or cell array of character vectors. A species object can be referenced by other
objects using its name. You can use the function |
speciesObj | Species object or vector of species objects. |
StoichCoefficient | Stoichiometric coefficients for reactants. Enter a positive scalar or vector of
positive doubles. If vector, it must have the same number of
elements as the number of species specified by
|
Description
creates a species object (if it does not exist already in the model) and returns the
species object (speciesObj
=
addreactant(reactionObj
, 'NameValue
')speciesObj
). In the species object, this
method assigns the value (NameValue
) to the property
Name
. In the reaction object, this method assigns the species
object to the property Reactants
, modifies the reaction equation in
the property Reaction
to include the new species, and adds the
stoichiometric coefficient -1
to the property
Stoichiometry
.
When you define a reaction with a new species:
If no compartment objects exist in the model, the method creates a compartment object (called
'
) in the model and adds the newly created species to that compartment.unnamed
'If only one compartment object (
compObj
) exists in the model, the method creates a species object in that compartment.If there is more than one compartment object (
compObj
) in the model, you must qualify the species name with the compartment name.For example,
cell.glucose
denotes that you want to put the species namedglucose
into a compartment namedcell
. Additionally, if the compartment namedcell
does not exist, the process of adding the reaction creates the compartment and names itcell
.
Create and add a species object to a compartment object with
the method addspecies
.
,
in the species object (speciesObj
= addreactant(reactionObj
, speciesObj
)
),
assigns the parent object of the
speciesObj
to the species property
reactionObj
Parent
. In the reaction object (reactionObj
),
it assigns the species object to the property Reactants
, modifies the
reaction equation in the property Reaction
to include the new
species, and adds the stoichiometric coefficient 1
to the property
Stoichiometry
.
,
in the species object (speciesObj
= addreactant(reactionObj
, speciesObj
, StoichCoefficient
)speciesObj
), assigns the parent object to the
speciesObj
property Parent
. In the reaction
object (reactionObj
), it assigns the species object to the property
Reactants
, modifies the reaction equation in the property
Reaction
to include the new species, and adds the stoichiometric
coefficient -1
to the property Stoichiometry
. If
speciesObj
is a cell array of species objects, then
StoichCoefficient
must be a vector of doubles with the
same length as speciesObj
.
,
in addition to the description above, adds the stoichiometric coefficient
(speciesObj
= addreactant(reactionObj
,
'NameValue
', StoichCoefficient
)StoichCoefficient
) to the property
Stoichiometry
. If NameValue
is a cell
array of species names, then StoichCoefficient
must be a
vector of doubles with the same length as NameValue
.
Species names are referenced by reaction objects, kinetic law
objects, and model objects. If you change the Name
of
a species the reaction also uses the new name. You must, however,
configure all other applicable elements such as rules that use the
species, and the kinetic law object.
For more information, see Guidelines for Naming Model Components.
Example
Create a model object, and then add a reaction object.
modelObj = sbiomodel('my_model'); reactionObj = addreaction(modelObj, 'A -> U');
Modify the
reaction
ofthe reactionObj
fromA
->U
to beA
+ 3C
->U
.speciesObj = addreactant(reactionObj, 'C', 3);
See Also
Version History
Introduced in R2006a