MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   如何找出文件的字节序? (https://www.labfans.com/bbs/showthread.php?t=26478)

poster 2019-12-14 20:13

如何找出文件的字节序?
 
如何确定它是大端文件还是小端文件?我只是尝试用matlab编写一个big-endian文件,但可能没有用。现在,我想了解是否有可能了解它的类型。有什么建议吗?



[B]回答:[/B]

使用[URL="http://www.mathworks.com/help/techdoc/ref/fopen.html"]FOPEN[/URL] :

fileID = fopen(fileName) [filename, permission, machineformat] = fopen(fileID) 第三个输出是machineformat ,它告诉您是大字节序( 'b' )还是小字节序( 'l' )。



[url=https://stackoverflow.com/questions/5187469]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 04:49

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.