Main Content


Get path to custom storage location for data logged to disk

Since R2021a



    storagePath = Simulink.sdi.getStorageLocation returns the configured custom location to store data logged to disk. When data logs to the temporary directory on your computer, the Simulink.sdi.getStorageLocation function returns an empty character array.


    The location returned by the Simulink.sdi.getStorageLocation function applies for data logged to the workspace and Simulation Data Inspector and is not the location of the file created for data logged to a file.


    collapse all

    By default, data logged to the workspace and the Simulation Data Inspector is stored in the temporary directory on your computer. You may want to change the location of logged data when you need to log large amounts of data and a secondary drive provides more storage capacity. When you specify a custom storage location for logged data, you can use the Simulink.sdi.getStorageLocation function to access the path to the temporary file that contains the logged data.

    storagePath = Simulink.sdi.getStorageLocation;
    storagePath =

    Output Arguments

    collapse all

    Location of data logged to disk, returned as a character vector. An empty character vector indicates that the data is logged to the temporary directory on your computer.

    Version History

    Introduced in R2021a