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

1 vue (au cours des 30 derniers jours)
Tom
Tom le 11 Mai 2012
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?

Réponses (1)

Walter Roberson
Walter Roberson le 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.

Catégories

En savoir plus sur Low-Level File I/O dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by