| SimBiology® | ![]() |
ruleObj = addrule(modelObj, 'RuleValue')
ruleObj = addrule(modelObj, 'RuleValue', 'RuleTypeValue')
ruleObj = addrule(..., 'PropertyName', PropertyValue,...)
| modelObj | Model object to which to add the rule. |
| RuleValue | Enter a character string within quotes. For example, enter the algebraic rule 'Va*Ea + Vi*Ei - K2'. |
| RuleTypeValue | Enter 'algebraic', 'initialassignment', 'repeatedAssignment', or 'rate'. See RuleType for more information. |
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, 'RuleValue') creates a rule object and returns the rule object (ruleObj). In the rule object, this method assigns a value ('RuleValue') to the property Rule, assigns the value 'algebraic' to the property RuleType, and assigns the model object (modelObj) to the property Parent. In the model object (modelObj), this method assigns the rule object to the property Rules.
ruleObj = addrule(modelObj, 'RuleValue', 'RuleTypeValue') in addition to the assignments above, assigns a value (RuleTypeValue) to the property RuleType. For more information on the different 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.
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 |
Properties for rule objects
| Active | Indicate object in use during simulation |
| Annotation | Store link to URL or file |
| 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 top-level SimBiology® object type |
| UserData | Specify data to associate with object |
Add a rule with 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 rule with RuleType property set to rate.
Create model object, 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: []![]() | addreaction (model) | addspecies (compartment) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |