3

I have a bunch of .mat files that were created on a PC (windows 8.1) using MATLAB 7.10.0 R2010a.

I am trying to use MATLAB 7.12.0 2011a on a MAC with Yosemite to open those files and they won't open. Here is how the file is saved on MATLAB 7.10.0 R2010a in Windows 8.1:

save('test.mat',test)

Here is how the file is loaded on MATLAB 7.12.0 2011a on a MAC with Yosemite

load 'test.mat'

I get the following error message:

??? Error using ==> load
Unable to read MAT-file /Users/User1/test.mat: not a
binary MAT-file.
Try LOAD -ASCII to read as text.

Error in ==> test at 63
    newdata = load(in_fname);

When I try double clicking any of the .mat files I get a bunch of java error messages in red font color.

I opened one of the .mat files in a text editor and the top of it says:

MATLAB 5.0 MAT-file, Platform: PCWIN,

Is there a way I can convert the files so that they read properly on a MAC?

I tried saving the files in 7.3 format by going to File-->Preferences-->General-->MAT-Files and switching the MAT-file save format to 7.3, but that didn't solve the problem.

Daniel
  • 36,610
  • 3
  • 36
  • 69
Veridian
  • 3,531
  • 12
  • 46
  • 80
  • Do you have access to the `save` syntax? Try changing the [version flag](http://www.mathworks.com/help/matlab/ref/save.html#inputarg_fmt) or maybe the file format. – sco1 Mar 19 '15 at 22:47
  • @excaza, Tried that, when I try to save as -ascii the file size is 0KB. And saving in 7.3 format didn't work either. – Veridian Mar 19 '15 at 22:59
  • Can you post exact error, exact commands to save/load, and maybe a (small) MAT file? Also, does this happen with any kind of data (even just a simple matrix), or only when you have more complicated things like structs, cell arrays, etc? – Nicu Stiurca Mar 19 '15 at 23:00
  • Can you go the other way? Does this happen with all data? – sco1 Mar 19 '15 at 23:14

1 Answers1

0

I have never had any problem copying Matlab files between Windows, Mac and Linux in any version of Matlab for the past 20 years. The problem I can see is that the files were transferred using FTP between computers and that FTP thought it was text, so it modified the file and then it was not readable under Matlab anymore. Use a flashdrive to transfer the file.

user1097111
  • 662
  • 5
  • 15