Unable to load previous .mat file versions in latest MATLAB version

조회 수: 2 (최근 30일)
divyasami27
divyasami27 2018년 3월 9일
댓글: Walter Roberson 2018년 5월 18일
I created a .mat file in MATLAB version : R2014a and I try to open it in a later MATLAB version: R2017b and I am getting the following error:
Unable to read MAT-file <my file path> Not a binary MAT-file. Try load -ASCII
to read as text.
  댓글 수: 11
divyasami27
divyasami27 2018년 5월 18일
Yes I did but I am not sure if we have the same situation. I was writing to the file on Linux and then reading from Windows, in short they have different new line sequences so this error shows up (Windows has extra stuff) as being a corrupted file. This was the cause, but I guess it didn't really solve the issue. You might try specifying the version of the MAT-file instead of just writing variables to it, like this save('a.mat','x','-v7')
Walter Roberson
Walter Roberson 2018년 5월 18일
.mat files are binary files that do not use line terminators.
Historically there could be problems sending binary files between systems by modem as the software was sometimes set to convert newline characters automatically (which does not work for binary files)... but those days are long behind us.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Standard File Formats에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by