Reading in and storing binary data

3 views (last 30 days)
Jared
Jared on 15 Oct 2012
I have very large binary files which have data points at points of time, with recorded parameters such as freq, amplitude, etc at each of those points in time.
I know the format the binary data is written. I'm not sure of the best way to organize the data as it is read in. I'm sure there are various philosophies on this... I was thinking of reading each data point in. Time, freq, amplitude. Each data point would be in a row, and each parameter in a column in that corresponding row.
I am assuming when it is read in and stored in an array, it will end up looking like a "normal human readable array", and not just each bit stored in an array, correct? Basically, that is what I am going for, and I want to make sure I am not trying to do something that isn't possible.

Answers (1)

Matt J
Matt J on 16 Oct 2012
Edited: Matt J on 16 Oct 2012
The syntax
A = fread(fid,[M,N],precision)
will read in a block of data to fill an MxN matrix, in column order. The elements of the matrix will each be a data point in your file (not an individual bit), but if they are not double floats, you must specify a non-default 'precision' argument.
  1 Comment
Jared
Jared on 16 Oct 2012
It seems I will run into an issue because the data points are not the same precision. For example, the time may be 8 bits, the frequency can be 20 bits. From what I can grasp of this process, I may have to do it data point by data point?

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!