Loading binary data into custom array
Mostrar comentarios más antiguos
Hi,
I'm trying to load in a binary data file with a unique data structure {uint32, uint32, double, double, double,.., double, uint32}. After doing a little bit of research, folks on the forums have recommended using the function "memmapfile()" to read in binary data files with custom arrays. The problem with this is my data is all in big-endian format and memmapfile() outputs the data in little endian format.
I'm looking for help as to whether or not memmapfile() can be produce a big-endian output without me using functions like swapbytes() or typecast() as it increases the loading/processing of the data significantly.
Any help is deeply appreciated,
MP
3 comentarios
Walter Roberson
el 23 de Dic. de 2020
I notice that https://github.com/DylanMuir/MappedTensor allows big-Endian
MPan
el 23 de Dic. de 2020
MPan
el 5 de En. de 2021
Respuestas (1)
weikang zhao
el 23 de Dic. de 2020
0 votos
The “fopen” function may be more flexible. It allows you to access the data in the binary file in any way, of course, including any data type and big-endian. The disadvantage is that it cannot be implemented with a simple function, and a script needs to be written.
1 comentario
MPan
el 23 de Dic. de 2020
Categorías
Más información sobre Large Files and Big Data en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!