not a binary MAT-file

Hello eveyone
I have a file with .mat extension file which I cant load and I get the following errror:
Not a binary MAT-file. Try load -ASCII to read as text.
I tried using dlmread('') command and also tried addpath('') but none of them worked.
I am attaching the file.
load('._lim1020_x1100_y7140.089.19.Vectrino Profiler.00000_y_D=0.3.mat');
Could you help me with this?
Thanks

3 件のコメント

mehra
mehra 2021 年 11 月 4 日
I realized that my file doesnt get attached to the question, I dont know why.
Image Analyst
Image Analyst 2021 年 11 月 4 日
Then zip it up and attach the zip file.
Image Analyst
Image Analyst 2021 年 11 月 7 日
I'm still not seeing your mat file or zip file. Where is it?

サインインしてコメントする。

回答 (1 件)

Yongjian Feng
Yongjian Feng 2021 年 11 月 4 日
編集済み: Yongjian Feng 2021 年 11 月 4 日

0 投票

  1. Use matfile to read the file?
  2. On linux, try this from a terminal
hexdump -c your_matfile.mat | more
3. On Windows, try this from a terminal
format-hex your_matfile.mat | more
Post the first line here.

14 件のコメント

mehra
mehra 2021 年 11 月 4 日
Tried it, gave the following error :
Error in matlab.io.MatFile (line 410)
obj.Properties = matlab.io.matfile.Properties(resolveSource(Source));
Error in matfile (line 75)
mf = matlab.io.MatFile(varargin{:});
Error in spectra_circ_st_xy (line 19)
matfile('._lim1020_x1100_y7140.089.19.Vectrino Profiler.00000_y_D=0.3.mat')
Yongjian Feng
Yongjian Feng 2021 年 11 月 4 日
Your file might not be a valid mat file. Try the commands above to show the first line of the file please.
mehra
mehra 2021 年 11 月 4 日
I entered the 3rd one (format-hex) in windowsPowershell it said that the format-hex is not recognized as the name of a cmdlet and....
Yongjian Feng
Yongjian Feng 2021 年 11 月 4 日
Try this:
certutil -encodehex your_matfile.mat tmp_mat.txt
It will generate a file called tmp_mat.txt. Open the file with Notepad and post the first 2 lines here.
mehra
mehra 2021 年 11 月 4 日
Attached file is the result. No notepad file is generated.
Yongjian Feng
Yongjian Feng 2021 年 11 月 4 日
Your file name has spaces. Need to put quotes like this:
certutil -encodehex "your file name with space.mat" tmp_mat.txt
mehra
mehra 2021 年 11 月 4 日
It says cant find the file
Yongjian Feng
Yongjian Feng 2021 年 11 月 4 日
You need to do it in the folder of that mat file. Or put the whole path.
Walter Roberson
Walter Roberson 2021 年 11 月 4 日
To be consistent with what you posted earlier,
certutil -encodehex "._lim1020_x1100_y7140.089.19.Vectrino Profiler.00000_y_D=0.3.mat" tmp_mat.txt
However, I see from your jpg that your attempt did not have the leading period and underscore. If those are part of the file name then they must be included.
Leading period is uncommon on Windows. On Mac and Linux it has special meaning when asking for directory listings (but no functional differences for the files.)
Yongjian Feng
Yongjian Feng 2021 年 11 月 4 日
Good catch Walter.
mehra
mehra 2021 年 11 月 7 日
I tried on the folder of that my data file was didnt work.
And about the period and underscore I have deleted them in another folder(renamed it) to give it a try without ._ and also I tried with the ._ non of them worked.
Also I couldn't send the file with zipping that!
Yongjian Feng
Yongjian Feng 2021 年 11 月 7 日
  1. Can you find the file from explorer?
  2. If so, can you make a copy, and call the new one just tmp.mat?
  3. from command line window, make sure you can dir tmp.mat
  4. now run the command
certutil -encodehex "tmp.mat" tmp_mat.txt
mehra
mehra 2021 年 11 月 7 日
you mean to search it in my files in my windows? If yes i tried it now it could not find it!! If the file has problem then maybe I should ask for the right file but I have to be sure that this file has problem
Thanks again
Yongjian Feng
Yongjian Feng 2021 年 11 月 8 日
Can you find it within matlab? You can do a copy and rename from matlab as well.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeFile Operations についてさらに検索

質問済み:

2021 年 11 月 4 日

コメント済み:

2021 年 11 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by