フィルターのクリア

How to use fread with sizeA involving 3D arrays?

6 ビュー (過去 30 日間)
Wei Yow
Wei Yow 2023 年 5 月 2 日
回答済み: Matt J 2023 年 5 月 2 日
When using fread, the size of the array is default for a two element row vector. What should i include if I need to read from a 3D array? [ row, col, frame]?
Data = fread(fid, [rows,cols], 'uint32', 'l');
Thanks in advance
  1 件のコメント
dpb
dpb 2023 年 5 月 2 日
Just read the array as vector and then reshape to the output size -- presuming was written in column-major order.
You'll have to know the order in which was written.

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

採用された回答

Matt J
Matt J 2023 年 5 月 2 日
One way:
Data = fread(fid, [rows,inf], 'uint32', 'l');
Data=reshape(Data,rows,cols,[]);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumeric Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by