Write to binary - undefined function or method fwrite for input arguments of type uint8

1 Ansicht (letzte 30 Tage)
Hi,
I have data in an matrix called LU I'm trying to write to a binary file. LU is of type uint8 and I need big endian encoding. I use: fid=fopen('00001-00600.00001-00600','w')
fwite(fid,LU,'uint8',0,'b')
But then I get the following error: undefined function or method 'fwrite' for input arguments of type 'uint8'
Why does this happen and how can I solve it?

Antworten (1)

Walter Roberson
Walter Roberson am 11 Mai 2012
That error should only be generated if the very first argument to fwrite() is of close uint8. Please re-check your code as you likely have a place in which you forgot the "fid" argument.
Note: Big-end encoding is meaningless for uint8. Big-end and little-end are only relevant when there are multiple bytes for an individual numeric value.

Kategorien

Mehr zu Low-Level File I/O finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by