Main Content

rmcontent (variant)

Remove contents from variant object

Syntax

rmcontent(variantObj, contents)
rmcontent(variantObj, idx)

Arguments

variantObjSpecify the variant object from which you want to remove data. The Content property is modified to remove the new data.
contents

Specify the data you want to remove from a variant object. Contents can either be a cell array or an array of cell arrays. A valid cell array should have the form {'Type', 'Name', 'PropertyName', PropertyValue}, where PropertyValue is the new value to be applied for the PropertyName. Valid Type, Name, and PropertyName values are as follows.

'Type''Name''PropertyName'
'species'Name of the species. If there are multiple species in the model with the same name, specify the species as [compartmentName.speciesName], where compartmentName is the name of the compartment containing the species.'InitialAmount'
'parameter'If the parameter scope is a model, specify the parameter name. If the parameter scope is a kinetic law, specify [reactionName.parameterName].'Value'
'compartment'Name of the compartment.'Capacity'

idxSpecify the ContentIndex or indices of the data to be removed. To display the ContentIndex, enter the object name and press Enter.

Description

rmcontent(variantObj, contents) removes the data stored in the variable contents from the variant object (variantObj).

rmcontent(variantObj, idx) removes the data specified by the indices idx (also called ContentIndex) from the Content property of the variant object.

Examples

  1. Create a model containing three species in one compartment.

    modelObj = sbiomodel('mymodel');
    compObj = addcompartment(modelObj, 'comp1');
    A = addspecies(compObj, 'A');
    B = addspecies(compObj, 'B');
    C = addspecies(compObj, 'C');
  2. Add a variant object that varies the species' InitialAmount property.

    variantObj = addvariant(modelObj, 'v1');
    addcontent(variantObj, {{'species','A', 'InitialAmount', 5}, ...  
    {'species', 'B', 'InitialAmount', 10}, ... 
    { 'species', 'C', 'InitialAmount', 15}});% Display the variant
    variantObj
    
    SimBiology Variant - v1 (inactive)
    
       ContentIndex:     Type:        Name:             Property:           Value:
       1                 species      A                 InitialAmount       5
       2                 species      B                 InitialAmount       10
       3                 species      C                 InitialAmount       15
  3. Use the ContentIndex number to remove a species from the Content property of the variant object.

    rmcontent(variantObj, 2);
    variantObj
    SimBiology Variant - v1 (inactive)
    
       ContentIndex:     Type:        Name:             Property:           Value:
       1                 species      A                 InitialAmount       5
       2                 species      C                 InitialAmount       15
  4. (Alternatively) Remove a species from the contents of the variant object using detailed reference to the species.

    rmcontent(variantObj, {'species','A', 'InitialAmount', 5});
    % Display variant object
    variantObj
    SimBiology Variant - v1 (inactive)
    
       ContentIndex:     Type:        Name:             Property:           Value:
       1                 species      C                 InitialAmount       15
    

Version History

Introduced in R2007b