getvariant
Get variant from model
Syntax
variantObj =
getvariant(modelObj)
variantObj =
getvariant(modelObj, 'NameValue')
Arguments
| Variant object returned by
the getvariant method. |
| Model object from which to
get the variant. |
' | Name of the variant to get from the model object
. |
Description
returns SimBiology® variant objects contained by the SimBiology
variantObj =
getvariant(modelObj)model object
to
modelObj.variantObj
A SimBiology variant object stores alternate values for properties on a SimBiology model. For more information on variants, see Variant object.
returns the SimBiology variant object with the name
variantObj =
getvariant(modelObj, 'NameValue'), contained by the SimBiology model object, NameValue.modelObj
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 addcontent method instead of using the
set method on the Content property, because the
set method replaces the data in the Content
property whereas addcontent appends the data.
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 several variants.
modelObj = sbiomodel('mymodel'); variantObj1 = addvariant(modelObj, 'v1'); variantObj2 = addvariant(modelObj, 'v2');Get all variants in the model.
vObjs = getvariant(modelObj)
SimBiology Variant Array Index: Name: Active: 1 v1 false 2 v2 false
Get the variant object named
'v2'from the model.vObjv2 = getvariant(modelObj, 'v2');
See Also
Version History
Introduced in R2007b