Main Content

rename

Rename SimBiology model component and update expressions

Description

example

rename(modelComponent,newName) changes the Name property of a SimBiology object modelComponent to newName and updates any uses of it in the model, such as rules, events, reactions, variants, and doses to use the new name. For details on naming requirements, see Guidelines for Naming Model Components.

Examples

collapse all

Create a SimBiology model that contains a species A, whcih is used in a rule.

m = sbiomodel("m1");
s = addspecies(m,"A");
r = addrule(m,"A = 4");

Rename the species to Y.

rename(s,"Y");

The rename function also updates other places in the model that reference the old name to the new name. For instance, the rule has been updated to use the new species name Y instead of A.

r
r = 
   SimBiology Rule Array

   Index:    RuleType:            Rule:
   1         initialAssignment    Y = 4

Input Arguments

collapse all

New object name, specified as a character vector or string.

Data Types: char | string

Version History

Introduced in R2008b