Main Content

addAction

Add user-defined action in MATLAB actor interface

Since R2023a

    Description

    addAction(interface,actionType,newAction) adds the user-defined action newAction of type actionType to the custom interface interface in the MATLAB® System object™ that models the behavior of an actor in RoadRunner Scenario.

    Input Arguments

    collapse all

    MATLAB System object interface, specified as a matlab.system.interface.* object. The custom interface allows you to accept and process user-defined actions defined in RoadRunner Scenario.

    Example: interface = ActorInterface();

    Action type that the custom interface accepts for further processing, specified as UserDefinedAction.

    User-defined action, specified as a matlab.system.interface.UserDefinedAction object. To define the input types, use the command newAction = matlab.system.interface.UserDefinedAction(actionName, actionElements).

    • actionName — Defines the name of the user-defined action. This value is specified as a character array.

    • actionElements — Defines the elements of a user-defined action. This value is specified as a structure that is initialized in the form s = struct(field1,value1,...,fieldN,valueN), where fieldN is the name of the Nth field, and valueN is its corresponding value.

    Example: actionElements = struct("ThrottleLevel","4","SteeringAngle","25");

    Version History

    Introduced in R2023a