addvariant (model)
Add variant to model
Syntax
variantObj =
addvariant(modelObj, 'NameValue')
variantObj2 =
addvariant(modelObj, variantObj)
Arguments
| Specify the Model object to
which you want add a variant. |
| Variant object to create
and add to the model object. |
| Name of the variant object. is
assigned to the Name property of the variant object. |
Description
creates a SimBiology® variant object (variantObj =
addvariant(modelObj, 'NameValue'))
with the name variantObjNameValue and adds the variant object to the
SimBiology
Model object
. The variant object
modelObjParent property is assigned the value of
. modelObj
A SimBiology variant object stores alternate values for
properties on a SimBiology model. For more information on variants,
see Variant object.
adds a SimBiology variant object (variantObj2 =
addvariant(modelObj, variantObj))
to the SimBiology model object and returns another variant object
variantObj. The variant object
variantObj2variantObj2Parent property is assigned the value of
. The
modelObjActive property of variantObj2 is set
to false by default.
View properties for a variant object with the command, and modify properties
for a variant object with the get command. set
Note
Remember to use the
addcontentmethod instead of using thesetmethod on theContentproperty, because thesetmethod replaces the data in theContentproperty, whereasaddcontentappends the data.When there are multiple active variant objects on a model, if there are duplicate specifications for a property's value, the last occurrence for the property value in the array of variants, is used during simulation.
To view the variants stored on a model object, use the getvariant method. To copy a variant
object to another model, use copyobj.
To remove a variant object from a SimBiology model, use the delete method.
Examples
Create a model containing one species.
modelObj = sbiomodel('mymodel'); compObj = addcompartment(modelObj, 'comp1'); speciesObj = addspecies(compObj, 'A');Add a variant object that varies the
InitialAmountproperty of a species named A.variantObj = addvariant(modelObj, 'v1'); addcontent(variantObj, {'species', 'A', 'InitialAmount', 5});
Version History
Introduced in R2007bSee Also
Model object | Variant object | addcontent | commit | copyobj | delete | getvariant