필터 지우기
필터 지우기

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 CenterFile Exchange에서 Numeric Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by