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.

Antworten (1)

David Hill
David Hill am 13 Jun. 2022

0 Stimmen

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

1 Kommentar

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')

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Large Files and Big Data finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 13 Jun. 2022

Kommentiert:

am 21 Jan. 2025

Community Treasure Hunt

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

Start Hunting!

Translated by