Loading binary data into custom array
Afficher commentaires plus anciens
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 commentaires
Walter Roberson
le 23 Déc 2020
I notice that https://github.com/DylanMuir/MappedTensor allows big-Endian
MPan
le 23 Déc 2020
MPan
le 5 Jan 2021
Réponses (1)
weikang zhao
le 23 Déc 2020
0 votes
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 commentaire
MPan
le 23 Déc 2020
Catégories
En savoir plus sur Large Files and Big Data dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!