receiveEvent
Description
listens for and returns event structure corresponding to received user-defined event
eventStruct
= receiveEvent(actorSim
,"UserDefinedEvent",eventName
)eventName
for actor actorSim
.
Examples
Receive User-Defined Event from a Scenario
Receive user-defined event TriggerOvertake
from a
scenario.
receiveEvent(actorWhiteSedan,"UserDefinedEvent","TriggerOvertake")
Input Arguments
actorSim
— Actor
ActorSimulation
object
Actor that receives an event, specified as an ActorSimulation
object.
eventName
— Name of user-defined event
string scalar | character vector
Name of user-defined event received from a scenario, specified as a string scalar or
character vector. The user-defined event must be defined and added to the interface of a
MATLAB®
System object™ actor model through the getInterfaceImpl
(Simulink) function.
Output Arguments
eventStruct
— Event structure
structure
User-defined event from a scenario, returned as a struct
.
Field Name | Description |
---|---|
LogicEvent | Information about the specified user-defined event, returned as a
struct . |
Name | Name of the user-defined event, returned as a
string . |
Parameters | Parameters of the user-defined event, returned as a
struct . This structure contains the name and value of
each custom parameter. |
This table describes the LogicEvent
structure.
Field Name | Description |
---|---|
EventType | Type of event, returned as an enumeration variable. The value of the variable can be:
|
PublishType | Method of publishing, returned as an enumeration variable. The value of the variable can be:
|
Version History
Introduced in R2023a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)