Main Content

Simulink.sdi.setStorageMode

Specify whether to log data to disk or memory

Since R2021a

    Description

    example

    Simulink.sdi.setStorageMode(storageMode) configures logging to log data to disk or to memory according to storageMode. By default, data logged to the workspace and the Simulation Data Inspector is logged to disk.

    Note

    When you change the logging storage mode, data from prior simulations is deleted. You cannot change the logging storage mode while a simulation is running.

    Examples

    collapse all

    You can configure whether data logged in simulation logs to memory or to disk. By default, data is logged to disk and brought into memory on demand. If your machine has more RAM than disk space, you may want to log data to memory instead.

    Use the Simulink.sdi.setStorageMode function to configure logging to log data to memory.

    Simulink.sdi.setStorageMode("memory");

    Input Arguments

    collapse all

    Where logged simulation data is stored on your machine, specified as 'disk' or 'memory'. By default, data logged to the workspace and the Simulation Data Inspector is logged to disk.

    When you change the storage mode to log data to memory:

    • Data logged from prior simulations is deleted.

    • Configuring limits on the size of logged data is not supported.

    You cannot change the storage mode while a simulation is running.

    When you configure a parallel worker to log to memory, sending logged data to the client is not supported.

    Logging data to memory is not supported for rapid accelerator simulations or models deployed using Simulink® Compiler™.

    Data Types: char | string

    Version History

    Introduced in R2021a