필터 지우기
필터 지우기

Reading in and storing binary data

조회 수: 5 (최근 30일)
Jared
Jared 2012년 10월 15일
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.

답변 (1개)

Matt J
Matt J 2012년 10월 16일
편집: Matt J 2012년 10월 16일
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
Jared
Jared 2012년 10월 16일
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?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by