MATLAB: How does MATLAB 7.0.2 (R14SP2) read data that is saved using a non-native byte order format

bebigbitbytebyte-swappingendianfilefopeni/oiolelinuxlittleMATLABnativesolarisswapping

I have a MAT-File that was saved on a system that stores data in big endian format. I wish to read this data on a system that uses the little endian byte format to store data.

Best Answer

This enhancement has been incorporated in Release 2006b (R2006b). For previous product releases, read below for any possible workarounds:
MATLAB saves numeric data to a MAT-file in the native byte format. When MATLAB reads a MAT-file, it determines whether byte-swapping needs to be performed by looking at a 2-byte integer in the 128-byte MAT-File header.
For more information about the MAT-File format, refer to the following URL:
In the case of file I/O functions, you can use a third input argument with the FOPEN function to specify whether or not byte-swapping is necessary depending on the native byte order.