rmcontent (variant)
Remove contents from variant object
Syntax
rmcontent(variantObj, contents)
rmcontent(variantObj, idx)
Arguments
| Specify the variant object from which you want to remove data.
The Content property is modified to remove the
new data. | ||||||||||||
| 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
| ||||||||||||
idx | Specify the ContentIndex or indices of the
data to be removed. To display the ContentIndex,
enter the object name and press Enter. |
Description
rmcontent( removes
the data stored in the variable variantObj, contents)contents from
the variant object (variantObj).
rmcontent( removes
the data specified by the indices variantObj, idx)idx (also
called ContentIndex) from the Content property of the variant object.
Examples
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'
InitialAmountproperty.variantObj = addvariant(modelObj, 'v1'); addcontent(variantObj, {{'species','A', 'InitialAmount', 5}, ... {'species', 'B', 'InitialAmount', 10}, ... { 'species', 'C', 'InitialAmount', 15}});% Display the variant variantObjSimBiology 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
ContentIndexnumber to remove a species from theContentproperty 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
See Also
Version History
Introduced in R2007b