www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/WriteBinaryFileWithBigendianByteOrderingExample.m

    %% Write Binary File with Big-Endian Byte Ordering
% Write random double-precision numbers to a file named |myfile.bin| for
% use on a big-endian system. Specify a |machinefmt| value of |'ieee-be'|
% in the call to |fwrite|, to indicate big-endian byte ordering.

% Copyright 2015 The MathWorks, Inc.

fileID = fopen('myfile.bin','w');
fwrite(fileID,rand(4),'double','ieee-be');
fclose(fileID);