removevariant(模型)
Remove variant from model
Syntax
variantObj
= removevariant(modelObj
, 'NameValue
')variantObj
= removevariant(modelObj
,variantObj
)
Arguments
|
Specify theModel object from which you want to remove the variant. |
|
Specify theVariant object to return from the model object. |
Description
removes a SimBiology®variant object with the namevariantObj
= removevariant(modelObj
, 'NameValue
')NameValue
from the model object
and returns the variant object tomodelObj
. The variant objectvariantObj
Parent
property is assigned[]
(empty).
A SimBiology variant object stores alternate values for properties on a SimBiology model. For more information on variants, seeVariant object
.
removes a SimBiology variant object (variantObj
= removevariant(modelObj
,variantObj
)
) and returns the variant objectvariantObj
.variantObj
To view the variants stored on a model object, use thegetvariant
method. To copy a variant object to another model, usecopyobj
. To add a variant object to a SimBiology model, use theaddvariant
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));