Help on opening a .fid file

조회 수: 33 (최근 30일)
Marina Batlló RIus
Marina Batlló RIus 2023년 4월 1일
편집: Walter Roberson 2024년 10월 22일
Hello, I am trying to open a .fid file in MATLAB. I do not have any other extra file or information, just the different .fid. The result should look like this:
I upload some example files. I have tried using fread, but I cannot manage to obtain the results.
Thanks in advance
  댓글 수: 3
Marina Batlló RIus
Marina Batlló RIus 2023년 4월 12일
Yes, but they did not get to a conclusion
Leandro
Leandro 2024년 10월 22일
편집: Walter Roberson 2024년 10월 22일

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

답변 (3개)

Abhishek
Abhishek 2023년 4월 12일
Hi Marina,
To read the file, it is recommended to open it using the function fopen. Once you have opened the file, you can read its contents using fread. Please refer to the following code snippet:
%Unzip the file
unzip('avg8.zip')
%Open the file for reading
myFidFile = fopen('avg7.fid');
%Read the file
fidData = fread(myFidFile);
%Plot
figure('Name','FID Data Plot')
plot(fidData)
%Close the file
fclose(myFidFile);
Here's what the resultant plot looks like:
For further information on file operations, please refer to the following documentation pages:
  1. File Operations - MATLAB & Simulink (mathworks.com)
  2. Low-Level File I/O - MATLAB & Simulink (mathworks.com)
  댓글 수: 1
Marina Batlló RIus
Marina Batlló RIus 2023년 4월 12일
Yes, but the result is not as expected, and I don't know why this happens. It is the same file, but I open it with MESTRENOVA instead of MATLAB.

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


Walter Roberson
Walter Roberson 2023년 4월 12일
There is no possible code that can read an arbitrary binary file and reliably extract the intended data. There is no international standard that requires that binary files must be in some structured form that self-describes what the data type and size of each section of data is.
For example if there are two binary bytes in the file, 10000000 10000001 then there is absolutely no way to tell whether the intent is 128 129, or 33152 or 32897 or -32384 or -32639 or an encoding for a character in LINEAR B, or a Start Of Record indicator followed by a record length of 129, or is intended to indicate "Mammal" "Aardvark", or something else completely different than any of these.
In order to decode an arbitrary binary file, you need documentation about the internal representation. Or you need access to the encoding program and the patience to do a lot of tests if writing out data in the program and seeing how it gets stored in the file.
So, you cannot expect us to be able to read and decode the file without information about what kind of file it is, and documentation from the manufacturer about how they store data.

Leandro
Leandro 2024년 10월 22일
Please read:
there are function there to do this.

카테고리

Help CenterFile Exchange에서 Low-Level File I/O에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by