This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

getstoichmatrix (model)

Get stoichiometry matrix from model object


M = getstoichmatrix(modelObj)
[M,objSpecies] = getstoichmatrix(modelObj)
[M,objSpecies,objReactions] = getstoichmatrix(modelObj)


MStoichiometry matrix for modelObj.
modelObjSpecify the model object.
objSpeciesReturn the list of modelObj species by Name property of the species.

If the species are in multiple compartments, species names are qualified with the compartment name in the form compartmentName.speciesName. For example, nucleus.DNA, cytoplasm.mRNA.

objReactionsReturn the list of modelObj reactions by the Name property of reactions.


getstoichmatrix returns a stoichiometry matrix for a model object.

M = getstoichmatrix(modelObj) returns a stoichiometry matrix for a SimBiology® model object (modelObj) to M.

A stoichiometry matrix is defined by listing all reactions contained by modelObj column-wise and all species contained by modelObj row-wise in a matrix. The species of the reaction are represented in the matrix with the stoichiometric value at the location of [row of species, column of reaction]. Reactants have negative values. Products have positive values. All other locations in the matrix are 0.

For example, if modelObj is a model object with two reactions with names R1 and R2 and Reaction values of 2 A + B -> 3 C and B + 3 D -> 4 A, the stoichiometry matrix would be defined as:

      R1   R2
A     -2    4
B     -1   -1
C      3    0
D      0   -3

[M,objSpecies] = getstoichmatrix(modelObj) returns the stoichiometry matrix to M and the species to objSpecies. objSpecies is defined by listing all Name property values of species contained by Obj. In the above example, objSpecies would be {'A', 'B', 'C', 'D'};.

[M,objSpecies,objReactions] = getstoichmatrix(modelObj) returns the stoichiometry matrix to M and the reactions to objReactions. objReactions is defined by listing all Name property values of reactions contained by modelObj. In the above example, objReactions would be {'R1', 'R2'}.


  1. Read in m1, a model object, using sbmlimport:

    m1 = sbmlimport('lotka.xml');
  2. Get the stoichiometry matrix for the m1:

    [M,objSpecies,objReactions] = getstoichmatrix(m1)

Introduced in R2006a