URGENT Unable to load .mat file

조회 수: 5 (최근 30일)
Mirlan Karimov
Mirlan Karimov 2020년 6월 4일
댓글: Mirlan Karimov 2020년 6월 5일
load('C:\Users\mirla\Desktop\my_data_folder\velocity_data.mat')
Not a binary .MAT file. Try load -ASCII to read as text
load('C:\Users\mirla\Desktop\my_data_folder\velocity_data.mat','-ascii')
Input must be a MAT-file or an ASCII file containing numeric data with same number of columns in each row.
The file is about 24 GB large and is from 2015, so probably last use with the version of that year.

답변 (1개)

Image Analyst
Image Analyst 2020년 6월 4일
Since it's not a binary .mat format file, but a text file, did you try opening it as text file and using fgetl() or fread() or textscan?
% Open the file for reading in text mode.
fileID = fopen(fullFileName, 'rt');
% Read the first line of the file.
textLine = fgetl(fileID);
lineCounter = 1;
while ischar(textLine)
% Print out what line we're operating on.
fprintf('%s\n', textLine);
% Read the next line.
textLine = fgetl(fileID);
lineCounter = lineCounter + 1;
end
% All done reading all lines, so close the file.
fclose(fileID);
Or you could try dlmread(), importdata(), or textscan().
  댓글 수: 4
Mirlan Karimov
Mirlan Karimov 2020년 6월 4일
That was a version problem, 2019 version opened with no issue. My laptop has 2020 and the office computer has 2019. That is crazy, I wasted hours on this :D Should I accept your answer, I have no clue. Thank you, anyway tho!
Mirlan Karimov
Mirlan Karimov 2020년 6월 5일
That was actually not a version problem, I opened it in my office computer and saved again as a mat file then it worked in my laptop too.

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

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

제품


릴리스

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by