Is there any difference in writing binary raw data files on Mac vs PC?

3 views (last 30 days)
I run code whose output is a data matrix which is fwrite() (floating point number, precision 4 bytes) out to a binary file. This code is run on a Mac (R2013b 64bit (maci64)) and Windows machine (R2014a 64bit). The resulting binary files e.g. data_mac.bin & data_win.bin are then fread() (floating point number, precision 4 bytes) into Matlab (on windows) as matrices e.g. data_mac & data_win. A subsequent function performed on these matrices take different amounts of time e.g. 100 s (win) and 250 s (mac).
So basically the code writes out two files in the exact same way with identical data on a Mac and PC. When I subsequently use those binary files, the calculations on the Mac file takes longer. Any ideas why this would be?
Thanks in advance for any ideas!
Anna
  4 Comments
Geoff Hayes
Geoff Hayes on 1 Jul 2014
The way I understood the question was that both the PC and the Mac produced a data file that was supposed to be identical. Using MATLAB on the PC, the PC version of the file was read and operated on, taking 100 seconds. The PC then did the same with the Mac version of the file, taking 250 seconds. There was no mention of performance, against either file, using the Mac.
@Anna - was the Mac file copied over to a local directory/folder on the PC?
dpb
dpb on 1 Jul 2014
...and the Mac produced a data file that was supposed to be identical.
Well, that's easy enough to check
diff fileA fileB
(presuming only a diff utility exists on the OP's machine (which actually, anymore may be a big if, I guess, mightn't it?))

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!