This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Variant Object

A variant object represents a variant, which is an alternate value for a compartment, species, or parameter in a model. You can apply this alternate value during a simulation, which lets you evaluate model behavior with a different value, without having to search and replace the value, or create an additional model with the new value.

You can use a variant to store an alternate value for any of the following:

The alternate value applies temporarily, only during a simulation, and does not alter the model's values permanently. If you determine that the values in a variant accurately define your model, you can permanently replace the values in your model with the values stored in the variant object by using the commit method.

Creating and Simulating with Variants

  1. Create a variant object and add it to a model using the addvariant method.

  2. (Optional) Set the Active property of the variant object to true if you always want the variant to be applied before simulating the model.

  3. Enter the model and variant object as input arguments to sbiosimulate. This applies the variant only for the current simulation and supersedes any active variant objects on the model.


    If you followed step 2, simply call sbiosimulate on the model object to apply the variant.

For an example of creating and using a variant in a model, see Simulate Biological Variability of the Yeast G Protein Cycle Using the Wild-Type and Mutant Strains.

For information about...See...
Creating and adding a variant to a modeladdvariant
Creating a stand-alone variantsbiovariant
Methods and properties of a variantVariant object
Appending contents to variantsaddcontent
Replacing model values permanently with values from a variantcommit

Simulating with Multiple Variants in a Model

When you use multiple variants during a simulation, and 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. You can find out which variant is applied last by looking at the indices of the variant objects stored on the model.

If you specify variants as arguments to sbiosimulate, this applies the variants for the current simulation in the order that they are specified, and supersedes any active variant objects on the model.

Similarly, in the variant contents (Content property), if there are duplicate specifications for a property's value, the last occurrence for the property in the contents is used during simulation.

Was this topic helpful?