I understand you want to access Simscape simulation data when running multiple simulation. To ensure that Simscape data is logged correctly, follow these steps:
- Go to “Model Settings” > “Simscape” and set “Log simulation data” to “All”
- Go to the “Simulation” tab, then under “Review Results”, click “Data Inspector”
Simulink uses the Simulation Data Inspector (SDI) to manage logged data. By default, SDI automatically archives data from previous runs (see the red rectangle in the image below), showing only the latest run’s data.
To view data from earlier runs, simply drag the archived runs from the archive section into the main view as shown:
Alternatively, if all simulation runs data should be kept visible without manually restoring them each time, auto-archiving functionality can be disabled by entering the following command in the MATLAB Command Window:
Simulink.sdi.setAutoArchiveMode(0);
mode = Simulink.sdi.getAutoArchiveMode;
To know more about configuring the SDI, refer to the MATLAB documentation below: