Main Content

get

Get logged scenario simulation data

    Description

    example

    loggeddata = get(log,'Parameter') returns simulation log data specified by Parameter from the Simulink.ScenarioLog object log.

    example

    loggeddata = get(log,'Parameter','ActorID','ID') returns simulation log data specified by Parameter for actor with identifier IDfrom the Simulink.ScenarioLog object log.

    Examples

    collapse all

    Set logging on for ss, a Simulink.ScenarioSimulation object.

    set(ss,'Logging','on')

    Get the simulation log after it stops playing.

    log = get(ss,'SimulationLog')

    Get the list of participating actors from the simulation.

    actors = get(log,'ActorIDs')
    actors =
    
         1     2     3

    Get the velocity of actor with actor ID 1.

    vel = get(log, 'Velocity', 'ActorID', 1)

    Input Arguments

    collapse all

    Scenario simulation log from which to return data, specified as a Simulink.ScenarioLog object.

    Example: actors = get(log,'ActorIDs')

    Information required from simulation log, specified as one of these parameters.

    • ActorIDs

    • Time

    • Diagnostics

    • Actions

    • Pose

    • Velocity

    • AngularVelocity

    • WheelPose

    Actor identifier, specified as a positive integer.

    Example: pose = get(log, 'Pose', 'ActorID', 5)

    Output Arguments

    collapse all

    Specific simulation log data, returned as an array or structure array.

    This table describes the output returned for each Parameter input argument.

    Input ArgumentOutput
    ActorIDsList of unique IDs of actors that participated in the simulation, returned as an array
    TimeEach time step of the simulation, returned as an array.
    DiagnosticsDiagnostics reported during the simulation, if any, returned as a structure array.
    ActionsActions of specified actor, if any, for each time step of the simulation, returned as a structure array.
    PosePose of specified actor for each time step of the simulation, returned as a structure array.
    VelocityVelocity of specified actor for each time step of the simulation, returned as a structure array.
    AngularVelocityAngular velocity of specified actor for each time step of the simulation, returned as a structure array.
    WheelPoseWheel pose of specified actor for each time step of the simulation, returned as a structure array.

    This table describes the fields of each structure within the Diagnostics structure array.

    Field NameDescription
    TimeSimulation time step at which diagnostic message is reported.
    MessageType

    Type of reported message, returned as an enumeration variable of the EnumDiagnosticType enumeration class.

    The value of EnumDiagnosticType variable can be:

    • Unspecified — The diagnostic type of reported message is unknown.

    • Information — The reported message is at the information level.

    • Warning — The reported message is at the warning level.

    • Error — The reported message is at the error level.

    MessageDiagnostic message text, returned as a string or character vector.

    This table describes the fields of each structure within the Actions structure array.

    Field NameDescription
    TimeEach simulation time step, from start to end.
    ActionActions of the specified actor, if any, at each simulation time step.

    This table describes the fields of each structure within the Pose structure array.

    Field NameDescription
    TimeEach simulation time step, from start to end.
    PosePose of the specified actor at each simulation time step.

    This table describes the fields of each structure within the Velocity structure array.

    Field NameDescription
    TimeEach simulation time step, from start to end.
    VelocityVelocity of the specified actor at each simulation time step.

    This table describes the fields of each structure within the AngularVelocity structure array.

    Field NameDescription
    TimeEach simulation time step, from start to end.
    AngularVelocityAngular velocity of the specified actor at each simulation time step.

    This table describes the fields of a structure within the WheelPose structure array.

    Field NameDescription
    TimeEach simulation time step, from start to end.
    WheelPose

    The wheel pose of the specified actor at each simulation time step.

    WheelPose is returned for wheels starting from the leftmost side of the front axle, and moving to the right. After the first axle is complete, the leftmost wheel of the second axle is taken into consideration before moving to the right, and so on.

    Version History

    Introduced in R2022a