Contenido principal

SimulinkPlatform

Specify MATLAB or Simulink platform

Since R2025b

    Description

    The SimulinkPlatform object represents the platform of a behavior asset defined in MATLAB® or Simulink®. The SimulinkPlatform object enables you to specify a MATLAB- or Simulink-authored file, such as a .m or .slx file, to associate to a BehaviorAsset in your RoadRunner scenario. For information on creating behaviors for RoadRunner Scenario using MATLAB and Simulink, see Overview of Simulating RoadRunner Scenarios with MATLAB and Simulink.

    Creation

    To create a SimulinkPlatform object, use the setPlatform function and specify the platformType argument as "SimulinkPlatform".

    For example, given the BehaviorAsset object, simBehavior, specifying simPlatform = setPlatform(simBehavior,"SimulinkPlatform"); creates a SimulinkPlatform object, simPlatform, and assigns it to the Platform property of simBehavior.

    To associate the SimulinkPlatform object with a behavior file, set the FileName property. The specified behavior file must originate from MATLAB and Simulink.

    Properties

    expand all

    Path to the behavior file, specified as a string scalar or character vector. You can specify an absolute or relative path to a behavior asset in the Assets folder of your RoadRunner project.

    Because behavior assets in RoadRunner Scenario must be .rrbehavior files, you must associate a MATLAB- or Simulink-authored file to a behavior asset to use it in your scenario. After creating a SimulinkPlatform object associated with a BehaviorAsset object, which represents a RoadRunner behavior asset, you must specify the FileName property of the SimulinkPlatform object as the location of the MATLAB or Simulink behavior file. The behavior file for the SimulinkPlatform object must be one of these file types:

    • .m

    • .slx

    • .zip

    • .slprotodata

    Example: simPlatform.FileName = "Behaviors/Custom_MATLAB_Behavior.m"; specifies for RoadRunner to use the file Custom_MATLAB_Behavior.m for the behavior asset.

    Version History

    Introduced in R2025b