EventFcns
Event expression
Description
Property of the event object that defines what occurs when the event is triggered. Specify a cell array of character vectors.
EventFcns
can be any MATLAB® assignment
or expression that defines what is executed when the event is triggered.
All EventFcn
expressions are assignments of the
form '
,
where objectname
= expression
'
is
the name of a valid SimBiology® object. objectname
For more information about how SimBiology handles events, see How Events Are Evaluated. For examples of event functions, see Specifying Event Functions.
Characteristics
Applies to | Object: event |
Data type | Cell array of character vectors |
Data values | Expressions for EventFcn (default is an
empty character vector '' ) |
Access | Read/write |
Tip
If UnitConversion
is
on and your model has any event, follow the recommendation below.
Non-dimensionalize any parameters used in the event Trigger
if they are not already dimensionless. For example, suppose you have
a trigger x > 1
, where x is the species
concentration in mole/liter. Non-dimensionalize x by scaling (dividing)
it with a constant such as x/x0 > 1
, where x0 is a
parameter defined as 1.0 mole/liter. Note that x does not have to have
the same unit as the constant x0, but must be dimensionally consistent
with it. For example, the unit of x can be picomole/liter instead of
mole/liter.
Examples
Create a model object, and then add an event object.
modelObj = sbmlimport('oscillator'); eventObj = addevent(modelObj, 'time>= 5', 'OpC = 200');
Set the
EventFcns
property of the event object.set(eventObj, 'EventFcns', {'pA = OpA','mA = pol'});
Get the
EventFcns
property.get(eventObj, 'EventFcns')