Is there a function to tell if Matlab is using little-endian or big-endian on current computer?
18 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
raym
el 17 de Dic. de 2024
Respondida: Steven Lord
el 17 de Dic. de 2024
Is there a function to tell if Matlab is using little-endian or big-endian on current computer?
0 comentarios
Respuesta aceptada
Más respuestas (1)
Matt J
el 17 de Dic. de 2024
Editada: Matt J
el 17 de Dic. de 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 comentarios
Ver también
Categorías
Más información sobre Entering Commands en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!