| SimBiology® | ![]() |
eventObj = addevent(modelObj, 'TriggerValue', 'EventFcnsValue')
eventObj = addevent(...'PropertyName', PropertyValue...)
| modelObj | Model object. |
| TriggerValue | Required property to specify a trigger condition. Must be a MATLAB expression that evaluates to a logical value. Use the keyword 'time' to specify that an event occurs at a specific time during the simulation. See Trigger, for more information. |
| EventFcnsValue | A string or a cell array of strings, each of which specifies an assignment of the form 'objectname = expression', where objectname is the name of a valid object. Defines what occurs when the event is triggered. See EventFcns, for more information. |
| PropertyName | Property name for an Event object from the table below. |
| PropertyValue | Property value. For more information on property values see the property reference for each property listed in the Property Summary. |
eventObj = addevent(modelObj, 'TriggerValue', 'EventFcnsValue') creates an event object (eventObj) adds the event to the model (modelObj). In the event object, this method assigns a value (TriggerValue) to the property TriggerCondition, assigns a value (EventFcnsValue) to the property EventFcns, and assigns the model object (modelObj) to the property Parent. In the model object, this method appends the event object to the property Events.
When the trigger expression, in the property Trigger, changes from false to true the assignments in EventFcns are executed during simulation.
For details on how events are handled during a simulation, see Events in the SimBiology® User's Guide.
eventObj = addevent(...'PropertyName', PropertyValue...) defines optional properties. The property
name and property value pairs can be any format supported by the function set (for example, name-value string pairs, structures,
and name-value cell array pairs).
You can view additional object properties with the get command. You can modify additional object properties with the set command. To view events of a model object (modelObj) use the command get(modelObj, 'Events').
| copyobj (any object) | Copy SimBiology® object and its children |
| display (any object) | Display summary of SimBiology® object |
| Active | Indicate object in use during simulation |
| Annotation | Store link to URL or file |
| EventFcns | Event expression |
| Name | Specify name of object |
| Notes | HTML text describing SimBiology® object |
| Parent | Indicate parent object |
| Tag | Specify label for SimBiology® object |
| Trigger | Event trigger |
| Type | Display top-level SimBiology® object type |
| UserData | Specify data to associate with object |
Create a model object, and then add an event object.
modelObj = sbmlimport('oscillator')
eventObj = addevent(modelObj, 'time>= 5', 'OpC = 200');Get a list of properties for an event object.
get(modelObj.Events(1));
Or,
get(eventObj)
MATLAB® displays a list of event properties.
Active: 1
Annotation: ''
EventFcns: {'OpC = 200'}
Name: ''
Notes: ''
Parent: [1x1 SimBiology.Model]
Tag: ''
Trigger: 'time >= 5'
Type: 'event'
UserData: []![]() | addcontent (variant) | addkineticlaw (reaction) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |