sbioconvertunits
Convert unit and unit value to new unit
Syntax
sbioconvertunits(Obj,
'unit')
Description
sbioconvertunits( converts the
current Obj,
'unit')*Units property on SimBiology® object, to
the unit, Obj. This
function configures the unit*Units property to and
updates the corresponding value property. For example, unitsbioconverunits on
a speciesObj updates the InitialAmount property
value and the InitialAmountUnits property value.
can be an
array of SimBiology objects. Obj must
be a SimBiology object that contains a unit property. The SimBiology objects
that contain a unit property are compartment, parameter, and species
objects. For example, if Obj is
a species object with ObjInitialAmount configured
to 1 and InitialAmountUnits configured
to mole, after the call to sbioconvertunits
with specified
as unitmolecule, speciesObj InitialAmount is 6.0221e23 and InitialAmountUnits is molecule.
Examples
Convert the units of the initial amount of glucose from molecule to mole.
Create the species
'glucose'and assign an initial amount of23 molecule.At the command prompt, type:
modelObj = sbiomodel('cell'); compObj = addcompartment(modelObj, 'C'); speciesObj = addspecies (compObj, 'glucose', 23, 'InitialAmountUnits', 'molecule') SimBiology Species Array Index: Compartment: Name: InitialAmount: InitialAmountUnits: 1 C glucose 23 moleculeConvert the
InitialAmountUnitsof glucose frommoleculetomole.sbioconvertunits (speciesObj, 'mole')
Verify the conversion of units and
InitialAmountvalue.Units are converted from molecule to mole.
get (speciesObj, 'InitialAmountUnits') ans = mole
The
InitialAmountvalue is changed.get (speciesObj, 'InitialAmount') ans = 3.8192e-023
Version History
Introduced in R2006a