sbiovariant

Construct variant object

Syntax

variantObj = sbiovariant('NameValue')

variantObj = sbiovariant('NameValue', 'ContentValue')

variantObj = sbiovariant(...'PropertyName', PropertyValue...)

Arguments

modelObjSpecify the model object to which you want add a variant.
variantObjVariant object to create and add to the model object.
NameValueName of the variant object. NameValue is assigned to the Name property of the variant object.

Description

variantObj = sbiovariant('NameValue') creates a SimBiology® variant object (variantObj) with the name NameValue. The variant object Parent property is assigned [] (empty).


variantObj = sbiovariant('NameValue', 'ContentValue')
creates a SimBiology variant object (variantObj) with the Content property set to ContentValue.

To add a variant to a model use the copyobj method. A SimBiology variant object stores alternate values for properties on a SimBiology model. For more information on variants, see Variant object.


variantObj = sbiovariant(...'PropertyName', PropertyValue...)
defines optional properties. The property name/property value pairs can be in any format supported by the function set (for example, name-value string pairs, structures, and name-value cell array pairs).

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

    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.

Method Summary

addcontent (variant)Append content to variant object
commit (variant)Commit variant contents to model
copyobj (any object)Copy SimBiology object and its children
delete (any object)Delete SimBiology object
display (any object)Display summary of SimBiology object
get (any object)Get object properties
rmcontent (variant)Remove contents from variant object
set (any object)Set object properties
verify (model, variant)Validate and verify SimBiology model

Property Summary

ActiveIndicate object in use during simulation
ContentContents of variant object
NameSpecify name of object
NotesHTML text describing SimBiology object
ParentIndicate parent object
TagSpecify label for SimBiology object
TypeDisplay SimBiology object type
UserDataSpecify data to associate with object

Examples

  1. Create a variant object.

    variantObj = sbiovariant('p1');
    
  2. Add content to the variant object that varies the InitialAmount property of a species named A.

    addcontent(variantObj, {'species', 'A', 'InitialAmount', 5});
Was this topic helpful?