Go Down

Topic: Best way to store data on an SD then transfer to MATLAB (Read 373 times) previous topic - next topic



I am using an SD card to store voltage values from an electrode, collecting values every 2ms.

Currently, I read use analogRead to read the voltage value then convert it to a string and print it to the .txt file on the SD card. I want to be able to easily parse and convert the data on the SD card to MATLAB where I can plot and analyze the data. Converting the integer value to a string and using a .txt file seems somewhat inefficient to me. What is the easiest and most efficient way to write data to an SD card and then bring it over to MATLAB? I am still a newbie with everything: arduino, data types, bits and bytes, and matlab.

After reading on Arduino, I was under the impression that .txt and .log files were the most common files for SD cards and Arduino. Usually when I use MATLAB to analyze data, the data is stored in a .dat file, could that be used.

Thank you for any assistance or insight in advance.


why not transfer the voltage values direct from the electrode to Matlab over a serial line?
how many voltage values are there every 2 mSec?
you could convert the value to a string but that slows transmission and can cause problems if you are transmitting many values/second (it does have the advantage of being human readable though)
the alternative and more efficent technique is to transfer binary values
I  assume you are using an AtoD converter - how may bits of conversion?
if greater than 8 bits you can transfer as two bytes if 16 bits or less

Go Up