Single bit read returning invalid precision

code to read a .wdq file is returning an invalid precision error when reading one bit.
info.hiResFile = fread(fid, 1, '*ubit1');
is the line refrenced in this error:
error: fread: invalid PRECISION specified
but as far as I can tell '*ubit1' is a valid precision value to read a single bit of data.

답변 (1개)

David Hill
David Hill 2022년 6월 13일

0 개 추천

b=fread('a.wdq',1,'ubit1');%this does not work?

댓글 수: 1

The first parameter to fread() must be a file identifier, not a file name.
filename = 'a.wdq';
[fid, msg] = fopen(filename, 'r');
if fid < 0
error('failed to open file "%s" because "%s"', filename, msg);
end
b = fread(fid, 1, 'ubit1')

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

카테고리

도움말 센터File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

태그

질문:

2022년 6월 13일

댓글:

2025년 1월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by