Main Content


Check record mode for logging

Since R2021a



    record = Simulink.sdi.getRecordData returns the currently configured value for the Record mode in the Simulation Data Inspector preferences. When record is true or 1, logged data is available to view during simulation and is recorded to the Simulation Data Inspector and workspace for analysis after simulation. When record is false or 0, logged data is not recorded and is only available to view during simulation.


    collapse all

    You can use the Simulink.sdi.getRecordData function to check the configuration before starting a simulation to ensure you record data you want to save.

    record = Simulink.sdi.getRecordData
    record =

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

    Output Arguments

    collapse all

    Record mode, returned as 1 (true) or 0 (false).

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

    • 0 — 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. For more information, see View Data Only During Simulation.

    Version History

    Introduced in R2021a