Skip to Main Content Skip to Search
Product Documentation

commit (variant) - Commit variant contents to model

Syntax

commit(variantObj, modelObj)

Arguments

modelObjSpecify the model object to which you want to commit a variant.
variantObjVariant object to commit to the model object.

Description

commit(variantObj, modelObj) commits the Contents property of a SimBiology variant object (variantObj) to the model object modelObj. The property values stored in the variant object replace the values stored in the model.

A SimBiology variant object stores alternate values for properties on a SimBiology model. For more information on variants, see Variant object.

The Contents are set on the model object in order of occurrence, with duplicate entries overwriting. If the commit method finds an incorrectly specified entry, an error occurs and the remaining properties defined in the Contents property are not set.

Examples

  1. Create a model containing one species.

    modelObj = sbiomodel('mymodel');
    compObj = addcompartment(modelObj, 'comp1');
    speciesObj = addspecies(compObj, 'A', 10);
  2. Add a variant object that varies the InitialAmount property of a species named A.

    variantObj = addvariant(modelObj, 'v1');
    addcontent(variantObj, {'species', 'A', 'InitialAmount', 5});
  3. Commit the contents of the variant (variantObj).

    commit (variantObj, modelObj);

See Also

addvariant, Variant object

  


Free Computational Biology Interactive Kit

See how to analyze, visualize, and model biological data and systems using MathWorks products.

Get free kit

Trials Available

Try the latest computational biology products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS