Extracting data from Dspace file
6:09 AM
The dSPACE is used widely now a days to validate the theoretical algorithms. The data file is usually in Microsoft access format that can be plotted using MATLAB. The data extraction is particularly helpful in genrating IV and PV curves based on the experimental data.
Here is the way to extract data from this file.
In this code the Y(1,4).Data) represents that the data has 4 data arrays. therefore, if the data has 2 arrays replace it by two. In order to plot all the data arrays simultaneously, the command of hold on can be utilized with two plot instructions. It is pertinent to mention that stepnew002 is the name of the variable (mat file) and it is a structure.
Rename the ydata available in work space and you are done.
Here is the way to extract data from this file.
- Copy the file in matlab directory
- Open the file using command load(space) file name (no extension is required)
- Create a blank m file and write the following code in it
plot(stepnew002.X.Data,stepnew002.Y(1,4).Data)
h = gcf; %
axesObjs = get(h, 'Children');
dataObjs = get(axesObjs, 'Children');
objTypes = get(dataObjs, 'Type');
ydata = get(dataObjs, 'YData');
In this code the Y(1,4).Data) represents that the data has 4 data arrays. therefore, if the data has 2 arrays replace it by two. In order to plot all the data arrays simultaneously, the command of hold on can be utilized with two plot instructions. It is pertinent to mention that stepnew002 is the name of the variable (mat file) and it is a structure.
Rename the ydata available in work space and you are done.
0 comments