Main Content

Simulink.sdi.setRecordData

Specify record mode for logging

Since R2021a

    Description

    example

    Simulink.sdi.setRecordData(record) configures the logging Record mode according to the value of record. When record is true, logged data is available to view during simulation and for analysis after simulation. When record is false, data is only available for viewing during simulation and is not available after simulation in the workspace or the Simulation Data Inspector.

    Examples

    collapse all

    In certain scenarios, you may want to only view logged data during simulation and not save any data to disk. For example, when using the Simulation Data Inspector to visualize data streaming from hardware, you may only want to view the data live and not record it. Use the Simulink.sdi.setRecordData function to configure the Record mode setting in the Simulation Data Inspector programmatically. To view data only during simulation, specify the input as false.

    Simulink.sdi.setRecordData(false)

    When you want to record logged data on disk so that it is available for analysis after simulation, call the Simulink.sdi.setRecordData function with true as the input.

    Simulink.sdi.setRecordData(true)

    The Record mode setting is restored to View and record data at the start of each MATLAB® session.

    Input Arguments

    collapse all

    Record mode, specified as numeric or logical 1 (true) or 0 (false).

    • true — Logged data is stored on disk and available in the workspace and the Simulation Data Inspector after simulation.

    • false — Logged data is not stored on disk and is only available to view during simulation. After simulation, no logged data is available in the Simulation Data Inspector or workspace.

    Specifying record as false can affect other applications. For more information, see View Data Only During Simulation.

    Data Types: logical

    Version History

    Introduced in R2021a