| Contents | Index |
ruleObj = addrule(modelObj, Rule)
ruleObj = addrule(modelObj, Rule, RuleType)
ruleObj = addrule(...,
'PropertyName', PropertyValue,...)
| modelObj | Model object to which to add the rule. |
| Rule | String specifying the rule. For example, enter the algebraic rule 'Va*Ea + Vi*Ei - K2'. |
| RuleType | String specifying the type of rule. Choices are:
For more information, see RuleType |
A rule is a mathematical expression that changes the amount of a species or the value of a parameter. It also defines how species and parameters interact with one another.
ruleObj = addrule(modelObj, Rule) constructs and returns ruleObj, a rule object. In ruleObj, the rule object, this method assigns the modelObj input argument to the Parent property, assigns the Rule input argument to the Rule property, and assigns 'initialAssignment' or 'algebraic' to the RuleType property. (This method assigns 'initialAssignment' for all assignment rules and 'algebraic' for all other rules.) In modelObj, the model object, this method assigns ruleObj, the rule object, to the Rules property.
ruleObj = addrule(modelObj, Rule, RuleType) in addition to the assignments above, assigns the RuleType input argument to the RuleType property. For more information on the types of rules, see RuleType.
ruleObj = addrule(...,
'PropertyName', PropertyValue,...) defines
optional properties. The property name/property value pairs can be
in any format supported by the function set (for
example, name-value string pairs, structures, and name-value cell
array pairs).
View additional rule properties with the function get, and modify rule properties with the function set. Copy a rule object to a model with the function copyobj, or delete a rule object from a model with the function delete.
Note If you use the addrule method to create an algebraic rule, rate rule, or repeated assignment rule, and the rule expression is not continuous and differentiable, see Using Events to Address Discontinuities in Rule and Reaction Rate Expressions before simulating your model. |
Methods for rule objects
| copyobj (any object) | Copy SimBiology object and its children |
| delete (any object) | Delete SimBiology object |
| display (any object) | Display summary of SimBiology object |
| get (any object) | Get object properties |
| set (any object) | Set object properties |
Properties for rule objects
| Active | Indicate object in use during simulation |
| Name | Specify name of object |
| Notes | HTML text describing SimBiology object |
| Parent | Indicate parent object |
| Rule | Specify species and parameter interactions |
| RuleType | Specify type of rule for rule object |
| Tag | Specify label for SimBiology object |
| Type | Display SimBiology object type |
| UserData | Specify data to associate with object |
Add a rule with the default RuleType.
Create a model object, and then add a rule object.
modelObj = sbiomodel('cell');
ruleObj = addrule(modelObj, '0.1*B-A')Get a list of properties for a rule object.
get(modelObj.Rules(1)) or get(ruleObj)
MATLAB displays a list of rule properties.
Active: 1
Annotation: ''
Name: ''
Notes: ''
Parent: [1x1 SimBiology.Model]
Rule: '0.1*B-A'
RuleType: 'algebraic'
Tag: ''
Type: 'rule'
UserData: []Add a rule with the RuleType property set to rate.
Create model object, and then add a reaction object.
modelObj = sbiomodel ('my_model');
reactionObj = addreaction (modelObj, 'a -> b');Add a rule which defines that the quantity of a species c. In the rule expression, k is the rate constant for a -> b.
ruleObj = addrule(modelObj, 'c = k*(a+b)')
Change the RuleType from default ('algebraic') to 'rate', and verify using the get command.
set(ruleObj, 'RuleType', 'rate'); get(ruleObj)
MATLAB returns all the properties for the rule object.
Active: 1
Annotation: ''
Name: ''
Notes: ''
Parent: [1x1 SimBiology.Model]
Rule: 'c = k*(a+b)'
RuleType: 'rate'
Tag: ''
Type: 'rule'
UserData: []
See how to analyze, visualize, and model biological data and systems using MathWorks products.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |