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, Objunit*Units property to unitsbioconverunits on
a speciesObj updates the InitialAmount property
value and the InitialAmountUnits property value. 
ObjObjObjInitialAmount configured
to 1 and InitialAmountUnits configured
to mole, after the call to sbioconvertunits 
with 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 of- 23 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 molecule
- Convert the - InitialAmountUnitsof glucose from- moleculeto- mole.- 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