This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

set (any object)

Set object properties


set(Obj, 'PropertyName', PropertyValue)
set(Obj, 'PropertyName1', PropertyValue1, 'PropertyName2', PropertyValue2...)



Abstract kinetic law, compartment, configuration set, event, kinetic law, model, parameter, PKCompartment, PKData, PKModelDesign PKModelMap, reaction, rule, SimData, species, or variant object.

'PropertyName'Name of the property to set.
PropertyValueSpecify the value to set. Property values depend on the property being set. See the reference page for an object property for values that can be specified.


set(Obj, 'PropertyName', PropertyValue) sets the property 'PropertyName' of the object Obj, to PropertyValue.

set(Obj, 'PropertyName1', PropertyValue1, 'PropertyName2', PropertyValue2...) sets the properties 'PropertyName1' and 'PropertyName2' to PropertyValue1 and PropertyValue2 respectively, and so on in sequence. You can specify multiple PropertyName, PropertyValue pairs.

When you want to change the name of a compartment, parameter, or species object, use the rename method instead of set. The rename method allows you to change the name and update the expressions in which these components are used.


  1. Create a model object.

    modelObj = sbiomodel ('my_model');
  2. Add parameter object.

    parameterObj = addparameter (modelObj, 'kf');
  3. Set the ConstantValue property of the parameter object to false and verify.

    MATLAB® returns 1 for true and 0 for false.

    set (parameterObj, 'ConstantValue', false);
    get(parameterObj, 'ConstantValue')

    MATLAB returns

    ans =

Introduced in R2008b