| Contents | Index |
rmcontent(variantObj, contents)
rmcontent(variantObj, idx)
| variantObj | Specify 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.
| ||||||||||||
| idx | Specify the ContentIndex or indices of the data to be removed. To display the ContentIndex, enter the object name and press Enter. |
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.
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');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
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
(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
addvariant, rmcontent, sbiovariant

See how to analyze, visualize, and model biological data and systems using MathWorks products.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |