Skip to Main Content Skip to Search
Product Documentation

getvariant (model) - Get variant from model

Syntax

variantObj = getvariant(modelObj)

variantObj = getvariant(modelObj, 'NameValue')

Arguments

variantObjVariant object returned by the getvariant method.
modelObjModel object from which to get the variant.
'NameValue'Name of the variant to get from the model object modelObj.

Description

variantObj = getvariant(modelObj) returns SimBiology variant objects contained by the SimBiology model object modelObj to variantObj.

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


variantObj = getvariant(modelObj, 'NameValue')
returns the SimBiology variant object with the name NameValue, contained by the SimBiology model object, modelObj.

View properties for a variant object with the get command, and modify properties for a variant object with the set command.

To copy a variant object to another model, use copyobj. To remove a variant object from a SimBiology model, use the delete method.

Examples

  1. Create a model containing several variants.

    modelObj = sbiomodel('mymodel');
    variantObj1 = addvariant(modelObj, 'v1');
    variantObj2 = addvariant(modelObj, 'v2');
    
  2. Get all variants in the model.

    vObjs = getvariant(modelObj)  
    SimBiology Variant Array
    
       Index:  Name:             Active:
       1       v1                false
       2       v2                false
  3. Get the variant object named 'v2' from the model.

    vObjv2 = getvariant(modelObj, 'v2');

See Also

addvariant, removevariant

  


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