Main Content

addparameter

Create parameter object and add to model or kinetic law object

Description

parameterObj = addparameter(modelKineticLawObj,parameterName) creates and returns a Parameter object parameterObj. The function also assigns

  • parameterName to the Name property of parameterObj.

  • modelKineticLawObj to the Parent property of parameterObj.

  • parameterObj to the Parameters property of the model object or kinetic law object modelKineticLawObj.

  • A value of 1 to the Value property of parameterObj.

example

parameterObj = addparameter(modelKineticLawObj,parameterName,parameterValue) also assigns the Value property of parameterObj to parameterValue.

parameterObj = addparameter(___,Name=Value) also sets the properties of the parameter object using one or more name-value arguments. Name is the property name and Value is the corresponding value.

example

Examples

collapse all

Create a model and add a reaction.

modelObj = sbiomodel('my_model');
reactionObj = addreaction(modelObj,'a + b -> c + d');

Define a kinetic law for the reaction object.

kineticlawObj = addkineticlaw(reactionObj, 'MassAction');

Add a parameter and assign it to the kinetic law object.

parameterObj1 = addparameter(kineticlawObj,'K1');

Add parameter with value 0.9 to the model object.

parameterObj2 = addparameter(modelObj,'K2',0.9);

Use get to retrieve a list of parameters that are scoped to the kinetic law object and model object.

get(kineticlawObj,'Parameters')
ans = 
   SimBiology Parameter Array

   Index:    Name:    Value:    Units:
   1         K1       1               

get(modelObj,'Parameters')
ans = 
   SimBiology Parameter Array

   Index:    Name:    Value:    Units:
   1         K2       0.9             

Input Arguments

collapse all

SimBiology model or kinetic law, specified as a Model or SimBiology.KineticLaw object.

Name of the parameter object, specified as a character vector or string scalar.

Data Types: char | string

Value of the parameter, specified as a numeric scalar.

Data Types: double

More About

collapse all

Version History

Introduced in R2006a

expand all