Reading a binary file in parts
5 ビュー (過去 30 日間)
古いコメントを表示
I have raw data from a sensor stored in a 1Gb binary file, and I would like to read it sequentially, i.e. in a loop, where the information is being processed simultaneously. In other words, as if the data were being received in real time. Is that possible in Matlab?
0 件のコメント
採用された回答
Alexander
2023 年 9 月 24 日
You should use fread.
4 件のコメント
Alexander
2023 年 9 月 24 日
移動済み: Voss
2023 年 9 月 24 日
Just some remarks:
If you are not short of memory you can use
in = fread(fid);
Than you have the whole bunch of bits and bytes in your vector "in". After that you can parse the data according your needs.
Second: If you have to deal often with the file directly, get familiar with the low level i/o functions of Matlab (i.e. fseek, frewind, feof, ..., these are similar like the functions in C language), then you can stroll through your file as you want.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File 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!