Main Content

initEventArray

Class: matlab.DiscreteEventSystem
Namespace: matlab

Initialize event array

Syntax

event = initEventArray()

Description

event = initEventArray() creates an empty array of event structures, to initialize the return of an event action method such as matlab.DiscreteEventSystem.entry. This method enables you to append elements to the array in the MATLAB Discrete-Event System block when the Code generation is selected for the Simulate using parameter.

Output Arguments

expand all

Array of event structures, specified as a MATLAB® structures.

Examples

expand all

Initialize returned event array for the exit method.

function events = exit(obj, ~, entity, ~)
            events = obj.initEventArray;
            if entity.data == 1
                events = obj.eventTimer('exit', 0);
           end
end

Version History

Introduced in R2017b