Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Read Unformatted SD Card in Matlab

Asked by David on 18 Sep 2013

I have raw data that was stored by an 8-bit micro-controller onto an unformatted SD Card. In the micro it treats the SD Card as a large unified flash file and will write bytes accordingly into SD Card memory. I now want to analyze the data in Matlab and I can't seem to find a work around for opening the SD Card as 1 large binary file. Windows recognizes that the SD Card is not formatted and therefore will not browse to the file in windows explorer. I've created a C# program that will open the SD Card using the CreateFile method and supplying \\.\PYISCALDRIVE1 as the file to open, the SD Card happens to be the 2nd drive on my computer. I can then write the file out as a text file but I would like to do this all from within Matlab if at all possible. 3rd party programs such as winHex can open the unformatted SD Card so it is a least possible for programs to access the file.

Any ideas on how to do this all from within Matlab?

Thank you

0 Comments

David

Products

No products are associated with this question.

1 Answer

Answer by Philip Borghesani on 19 Sep 2013
Accepted answer

This probably can't be done entirely within MATLAB. I suggest turning your C# code into a library that can be accessed using the MATLAB .net interface or if you also know c writing a mex file to access the data.

1 Comment

David on 19 Sep 2013

I was afraid that was going to be the answer, I can compile into a DLL or mex the function in C so that shouldn't be a problem. I was just hoping for a Matlab work around. Thank you for the response.

Philip Borghesani

Contact us