You can configure your model and the Simulation Data Inspector to automatically recorded data from a simulation run.
Set up your model to log signal data, as in Export Signal Data Using Signal Logging.
Select Simulation > Model Configuration Parameters to open the Configuration Parameters dialog box.
In the Data Import/Export pane:
Select the Signal logging check box.
Select the Record and inspect simulation output check box.
Click Apply and OK.
To open the Simulation Data Inspector, on the Simulink® Editor toolbar, click the Record button arrow.
From the menu, select Simulation Data Inspector.
To specify run configuration options, in the Simulation Data Inspector, click the Run Configuration button.
To specify that new runs are added to the top of the run list, in the Run Configuration dialog box, select Add new runs at top.
To specify the rule for the run name, enter available tokens from the list and any other characters in the Run naming rule box.
For more information, see Run Management Configuration.
On the Simulink Editor toolbar, click the Record button on. You can click the Record button to toggle on and off recording data for a simulation.
Simulate the model.
When the simulation is done, a notification bar appears in the Simulink Editor.
In the notification bar, click the link to open the Simulation Data Inspector.
The simulation data automatically appears in the Signal Browser table.
To record another simulation run, leave the Record button on, and simulate the model again.
When the simulation is done, the data appears as another new run. To configure the Simulation Data Inspector to overwrite a run, see Overwrite a Run.
When you are done importing data for your simulations, click the Record button off.