0% found this document useful (0 votes)
91 views

Exporting Data From Simulink To Matlab Workspace

This document provides a 7-step process for exporting data from Simulink models to the Matlab workspace. The steps include configuring the model settings, selecting signals to export, setting the logging properties for those signals, running the model, and accessing the exported data as two-column arrays in the Matlab workspace with time in the first column and measured values in the second column. The data can then be plotted and copied to other documents.

Uploaded by

rishi garg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views

Exporting Data From Simulink To Matlab Workspace

This document provides a 7-step process for exporting data from Simulink models to the Matlab workspace. The steps include configuring the model settings, selecting signals to export, setting the logging properties for those signals, running the model, and accessing the exported data as two-column arrays in the Matlab workspace with time in the first column and measured values in the second column. The data can then be plotted and copied to other documents.

Uploaded by

rishi garg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Exporting data from Simulink to Matlab workspace

Step 1)
In the Simulink model, select MODELING tab, and then click on “Model Settings”

Step 2)
Select Data Import/Export , and uncheck the “Single simulation output” box
Step 3)
Double click on the scope for the signal that will be exported to Matlab workspace

Step 4)
Open Configuration Properties
Step 5)
Select the Logging tab, check “Log data to workspace” check box and specify the variable name
that will be used in Matlab workspace. Select “Array” as the save format. Also, variable
decimation can be specified. Larger the decimation is, less data points will be saved. Decimation
should be kept between 1 and 10.

Step 6)
Aafter the model is run, all variables logged by scopes in Simulink (configured in step 5) are
available in Matlab workspace. Each variable is a two column arrays where the first column is
time and second is the actual quantity captured by the scope.
The following command plots the data:
plot(Ia(:,1),Ia(:,2),'LineWidth',2),grid
Ia(:,1) – first column of the Ia array (time)
Ia(:,2) – second column of the Ia array (actual current Ia)
Step 7)
The figure can be copied and pasted in a Word (or any other) document. Select Edit->Copy
Figure, to copy the figure to clipboard.

You might also like