Reading in and storing binary data

3 visualizaciones (últimos 30 días)
Jared
Jared el 15 de Oct. de 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.

Respuestas (1)

Matt J
Matt J el 16 de Oct. de 2012
Editada: Matt J el 16 de Oct. de 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 comentario
Jared
Jared el 16 de Oct. de 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?

Iniciar sesión para comentar.

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by