Main Content

get

Get value of scenario simulation parameter

    Description

    example

    param = get(ScenarioSim,'Param') returns the value of the specified parameter Param from a scenario simulation ScenarioSim at runtime.

    Examples

    collapse all

    Create ss, a Simulink.ScenarioSimulation object.

    rrApp = roadrunner('C:\Project\TestHighwayRoute');
    openScenario(rrApp,'myScenario1');
    ss = createSimulation(rrApp);

    Get the current simulation status.

    simstatus = get(ss,'SimulationStatus')
    

    Get the log data history associated with the simulation.

    loggeddata = get(ss,'SimulationLog')

    Get all actors from a scenario.

    actors = get(ss,'ActorSimulation')

    Get a specific actor using its corresponding Simulink model handle.

    actorsim = get(ss,'ActorSimulation', 'SimulinkModel', mdHdl)

    Get a specific actor using the System object™ that represents its runtime behavior. This operation is possible only if an actor is already associated with a MATLAB® System object.

    actorsysobj = get(ss,'ActorSimulation', 'SystemObject', obj)

    Get a specific actor using its corresponding Simulink.ActorModel object name.

    actormod = get(ss,'ActorSimulation', 'ActorModel', actorModel)

    Input Arguments

    collapse all

    RoadRunner Scenario simulation, specified as a Simulink.ScenarioSimulation object.

    Example: simstatus = get(ScenarioSim,'SimulationStatus')

    Scenario simulation parameter, specified as one of these string values.

    ParameterDescription
    StepSizeStep size of simulation
    MaxSimulationTimeMaximum simulation time of scenario
    PacerStatusPacer status of simulation
    SimulationPacePace of simulation
    SimulationStatusStatus of simulation
    SimulationLogLogged simulation data
    ActorSimulationActors in simulation
    ActorSimulation', 'SimulinkModel', mdHdlActor in simulation corresponding to specified Simulink model handle
    ActorSimulation', 'SystemObject', objActor in simulation corresponding to specified System object
    ActorSimulation', 'ActorModel', actorModelActor in simulation corresponding to specified Simulink.ActorModel object

    Example: simpace = get(ScenarioSim,'SimulationPace')

    Output Arguments

    collapse all

    Value of parameter, returned as one of these data types.

    ParameterData Type of Output
    StepSizedouble
    MaxSimulationTimedouble
    PacerStatuschar or string
    SimulationPacedouble
    SimulationStatuschar or string
    SimulationLogSimulink.ScenarioLog object
    ActorSimulationSimulink.ActorSimulation object
    ActorSimulation', 'SimulinkModel', mdHdlSimulink.ActorSimulation object
    ActorSimulation', 'SystemObject', objSimulink.ActorSimulation object
    ActorSimulation', 'ActorModel', actorModelSimulink.ActorSimulation object

    Version History

    Introduced in R2022a