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 comentarios

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

Iniciar sesión para comentar.

Respuestas (1)

Yongjian Feng
Yongjian Feng el 4 de Nov. de 2021
Editada: Yongjian Feng el 4 de Nov. de 2021

0 votos

  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 comentarios

mehra
mehra el 4 de Nov. de 2021
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 el 4 de Nov. de 2021
Your file might not be a valid mat file. Try the commands above to show the first line of the file please.
mehra
mehra el 4 de Nov. de 2021
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 el 4 de Nov. de 2021
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 el 4 de Nov. de 2021
Attached file is the result. No notepad file is generated.
Yongjian Feng
Yongjian Feng el 4 de Nov. de 2021
Your file name has spaces. Need to put quotes like this:
certutil -encodehex "your file name with space.mat" tmp_mat.txt
mehra
mehra el 4 de Nov. de 2021
It says cant find the file
Yongjian Feng
Yongjian Feng el 4 de Nov. de 2021
You need to do it in the folder of that mat file. Or put the whole path.
Walter Roberson
Walter Roberson el 4 de Nov. de 2021
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 el 4 de Nov. de 2021
Good catch Walter.
mehra
mehra el 7 de Nov. de 2021
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 el 7 de Nov. de 2021
  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 el 7 de Nov. de 2021
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 el 8 de Nov. de 2021
Can you find it within matlab? You can do a copy and rename from matlab as well.

Iniciar sesión para comentar.

Categorías

Más información sobre File Operations en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 4 de Nov. de 2021

Comentada:

el 8 de Nov. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by