Main Content


Specify name of object


The Name property identifies a SimBiology® object. Compartments, species, parameters, observables, and model objects can be referenced by other objects using the Name property, therefore Name must be unique for these objects. However, species names need only be unique within each compartment. Parameter names must be unique within a model (if at the model level), or within each kinetic law (if at the kinetic law level). This means that you can have nonunique species names if the species are in different compartments, and nonunique parameter names if the parameters are in different kinetic laws or at different levels. Note that having nonunique parameter names can cause the model to have shadowed parameters and that may not be best modeling practice.

Use the function sbioselect to find an object with the same Name property value.

In addition, note the following constraints and reserved characters for the Name property in objects:

  • Model and parameter names cannot be empty, the word time, all whitespace, or contain the characters [ or ].

  • Compartment and species names cannot be empty, the word null, the word time or contain the characters ->, <->, [ or ].

    • However, compartment and species names can contain the words null and time within the name, such as nulldrug or nullreceptor.

  • Reaction, event, and rule names cannot be the word time or contain the characters [ or ].

  • If you have a parameter, a species, or compartment name that is not a valid MATLAB® variable name, when you write an event function, an event trigger, a reaction, reaction rate equation, or a rule you must enclose that name in brackets. For example, enclose [DNA polymerase+] in brackets. In addition, if you have the same species in multiple compartments you must qualify the species with the compartment name, for example, nucleus.[DNA polymerase+], [nuclear complex].[DNA polymerase+].

For more information on valid MATLAB variable names, see matlab.lang.makeValidName, matlab.lang.makeUniqueStrings, and isvarname.


Applies toObjects: abstract kinetic law, configuration set, compartment, event, kinetic law, model, observable, parameter, reaction, RepeatDose, rule, ScheduleDose, species, unit, or variant
Data typeCharacter vector
Data valuesAny character vector except reserved words and characters


  1. Create a model object named my_model.

    modelObj = sbiomodel ('my_model');
  2. Add a reaction object to the model object. Note the use of brackets because the names are not valid MATLAB variable names.

    reactionObj = addreaction(modelObj, '[Aspartic acid] -> [beta-Aspartyl-PO4]')

    MATLAB returns:

    SimBiology Reaction Array
    Index:    Reaction:
      1       [Aspartic acid] -> [beta-Aspartyl-PO4]
  3. Set the reaction Name and verify.

    set (reactionObj, 'Name', 'Aspartate kinase reaction');
    get (reactionObj, 'Name')

    MATLAB returns:

    ans =
      Aspartate kinase reaction

Version History

expand all