| Contents | Index |
rename(Obj, 'NewNameValue')
| Obj | Compartment, parameter, or species object. |
| 'NewNameValue' | Specify the new name. |
rename(Obj, 'NewNameValue'), changes the Name property of the object, Obj to NewNameValue and updates any expressions in the model (such as Rule or ReactionRate) to use the new name.
If the new name is already being used by another model component, the new name will be qualified to ensure that it is unique. For example if you change a species named A to K, and a parameter with the name K exists, the species will be qualified as CompartmentName.K to indicate that the reference is to the species. If you are referring to an object by it's qualified name, for example CompartmentName.A and you change the species name, the reference will contain the qualified name in it's updated form, for example, CompartmentName.K
When you want to change the name of a compartment, parameter, or species object, use this method instead of set. The set method only changes the Name property of the object, except for species objects where the species object's Name property and any reaction strings which refer to species are updated to use the new name.
Create a model object that contains a species A in a rule.
m = sbiomodel('cell');
s = addspecies(m, 'A');
r = addrule(m, 'A = 4');
Rename the species to Y
rename(s, 'Y');
See that the rule expression is now updated.
r
SimBiology Rule Array Index: RuleType: Rule: 1 initialAssignment Y = 4

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 |