rename
Rename object and update expressions
Syntax
rename(
Obj
, 'NewNameValue
')
Arguments
| Abstractkineticlaw, compartment, event, kinetic law, model, parameter, RepeatDose, reaction, rule, ScheduleDose, species, unit, unitprefix, variant, or observable object. |
' | Specify the new name. |
Description
rename(
,
changes the Obj
, 'NewNameValue
')Name
property of the object,
Obj
to
and updates any uses of
it in the model such as rules, events, reactions, variants, and doses to use the new
name.NewNameValue
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
to indicate that
the reference is to the species. If you are referring to an object by its qualified
name, for example CompartmentName
.K
and
you change the species name, the reference will contain the qualified name in its
updated form, for example,
CompartmentName
.ACompartmentName
.K
When you want to change the name of a compartment, parameter, species, or reaction
object, use this method instead of set
.
Note
The set
method only changes the
Name
property of the object, except for species and
compartments. The method updates the species or compartment object's
Name
property and any reaction strings referring to the
species or compartment to use the new name.
Examples
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 Also
Version History
Introduced in R2008b