フィルターのクリア

How to proceed on opening a bin/binx file?

6 ビュー (過去 30 日間)
Raju Kumar
Raju Kumar 2021 年 2 月 8 日
回答済み: Walter Roberson 2022 年 10 月 7 日
Hello all,
I am trying to read a bin/binx file (see the format attached). I am here to ask how do I proceed? What parameters/information is needed to begin with? Your help is much appreciated. Thank you.
  3 件のコメント
Raju Kumar
Raju Kumar 2021 年 2 月 8 日
Hi Rik, Thank you for your reply. That is correct. It is a bin. file opened in a viewer. What else I should know (apart from the file type)? Could you please elaborate a bit? Thank you.
Walter Roberson
Walter Roberson 2021 年 2 月 8 日
It looks like binx is Binary XML

サインインしてコメントする。

回答 (2 件)

Krishna
Krishna 2022 年 10 月 7 日
Hi Raju,
If you have a binary file, you can read from it using the following commands,
fid = fopen('data.bin','rb') % opens the file for reading
A = fread(fid, count, 'int16') % reads _count_ elements and stores them in A.
The commands fopen and fread default to Little-endian[1] encoding for the integers. If your file is Big-endian encoded you will need to change the fread to
A = fread(fid, count, 'int16', 'ieee-be');
And if you want to read the file's data into matrix with n columns use
count=[n inf];

Walter Roberson
Walter Roberson 2022 年 10 月 7 日
.binx files are an extension to XML to provide keywords to describe binary files. The .binx file is XML does not contain the binary data itself: it refers to it by URI; the .binx having provided structured information to describe the file format.
Unfortunately at the moment I do not see any functions to read from such files -- not in MATLAB, not in Python.

カテゴリ

Help Center および File ExchangeLow-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