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 件のコメント
Walter Roberson
2022 年 6 月 13 日
Which MATLAB version are you using?
回答 (1 件)
David Hill
2022 年 6 月 13 日
b=fread('a.wdq',1,'ubit1');%this does not work?
1 件のコメント
Walter Roberson
2025 年 1 月 21 日
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 で Low-Level File I/O についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!