Is there a function to tell if Matlab is using little-endian or big-endian on current computer?
20 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
raym
le 17 Déc 2024
Réponse apportée : Steven Lord
le 17 Déc 2024
Is there a function to tell if Matlab is using little-endian or big-endian on current computer?
0 commentaires
Réponse acceptée
Plus de réponses (1)
Matt J
le 17 Déc 2024
Modifié(e) : Matt J
le 17 Déc 2024
function endianType = checkEndian()
% Typecast uint16(1) to uint8 to examine the byte order
byteValue = typecast(uint16(1), 'uint8');
% Check the first byte to determine endianness
if byteValue(1) == 1
endianType = 'little-endian';
else
endianType = 'big-endian';
end
end
0 commentaires
Voir également
Catégories
En savoir plus sur Entering Commands dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!