removevariant (model)
Remove variant from model
Syntax
variantObj
=
removevariant(modelObj
, 'NameValue
')
variantObj
=
removevariant(modelObj
, variantObj
)
Arguments
| Specify the Model object from which you
want to remove the variant. |
| Specify the Variant object to return
from the model object. |
Description
removes
a SimBiology® variant object with the name variantObj
=
removevariant(modelObj
, 'NameValue
')NameValue
from
the model object
and
returns the variant object to modelObj
.
The variant object variantObj
Parent
property is assigned []
(empty).
A SimBiology variant object stores alternate values for
properties on a SimBiology model. For more information on variants,
see Variant object
.
removes
a SimBiology variant object (variantObj
=
removevariant(modelObj
, variantObj
)
)
and returns the variant object variantObj
. variantObj
To view the variants stored on a model object, use the getvariant
method. To copy a variant
object to another model, use copyobj
.
To add a variant object to a SimBiology model, use the addvariant
method.
Examples
Create a model containing several variants.
modelObj = sbiomodel('mymodel'); variantObj1 = addvariant(modelObj, 'v1'); variantObj2 = addvariant(modelObj, 'v2'); variantObj3 = addvariant(modelObj, 'v3');
Remove a variant object using its name.
removevariant(modelObj, 'v1');
Remove a variant object using its index number.
Get the index number of the variant in the model.
vObjs = getvariant(modelObj)
SimBiology Variant Array Index: Name: Active: 1 v2 false 2 v3 false
Remove the variant object.
removevariant(modelObj, vObjs(2));
See Also
Version History
Introduced in R2007b