Is it possible to create a binary vector then write it to a file?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi Matlab Comminity,
I am new to Matlab. I am working on an excercise which requires some binary operations, then write binary result in a file. Each character in the file must be 1 bit.
I tried looking for "binary datatype in Matlab", but it seems does not exist. I am little bit disappointed.
Could you guys give me some suggestions? What would you do when you want to work with binary number in Matlab?
Thank you so much!
0 Kommentare
Antworten (2)
Walter Roberson
am 20 Mai 2016
fwrite(fileID, B, 'ubit1')
Caution: bits are only packed for any one call to fwrite(). Each time the data for an fwrite is finished outputting, if the bit stream is not aligned with a byte boundary then extra bits are written out to get to the byte boundary, leaving it positioned at a byte boundary for the next I/O call.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Environment and Settings 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!