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.

  1. Copy the file in matlab directory
  2. Open the file using command load(space) file name (no extension is required)
  3. 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.

You Might Also Like

0 comments

Copyright statement

Copyright © 2015-2017 by Hadeed A Sher

All rights reserved. No part of this blog may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without my prior written permission. For permission requests, write to the blog author addressed “Attention: Permissions Coordinator,” at the contact form.


Disclaimer

This blog is about my PhD work and an archive to my engineering education. However, additional study material for the courses i teach and that i have studied is also archived here.
All the circuits in this blog are tested by myself under specific conditions. BE CAREFUL if you are experimenting them, the blogger and this blog are not responsible to any harm and or damage to yourself and your equipment.


Contact form

Name

Email *

Message *