How do I map a few binary words containing sub-words (various bit lengths/types/locations) into Matlab variables? The binary data is generated externally to Matlab in fixed length blocks (8 words), as a file. Memmapfile can be used for reading the binary data from the file and it nearly does what I need except that the mapping of bits to variables names is not flexible enough. For example, suppose the 3rd word contains a signed integer from Bit 7 to Bit 12 and the 5th word contains an unsigned integer in Bit 9 to Bit 17. Is there an efficient way to map these into Matlab so that I can handle them directly as variables? In 'C' it could be done by using a UNION. Is there anything similar in Matlab? Thanks!
MATLAB: Mapping a fixed bit structure into Matlab variables
MATLABstructures
Best Answer