How to take a .dat file and be able to load it as a .mat file in MATLAB

6 visualizaciones (últimos 30 días)
I have a .dat file that I've been trying to load in MATLAB. I cannot figure it out.
  4 comentarios
Walter Roberson
Walter Roberson el 26 de Abr. de 2020
Sorry, I cannot download the file to test as I do not have a login for there. I also cannot search those pages to locate context of what the file is even for to try to get some idea of what it might contain.
.dat can be any kind of data file. There is absolutely no standard for .dat : most applications that have their own private data file format calls call them .dat . There is nothing we can do for you without either context or a copy of the file (and even a copy of the file is not certain to be sufficient.)
Carter Kunert
Carter Kunert el 26 de Abr. de 2020
That's all good. I appreciate your help.

Iniciar sesión para comentar.

Respuestas (1)

Image Analyst
Image Analyst el 26 de Abr. de 2020
Why do you think the .data file in in proprietary MAT file format, just with a different extension? If it is, this should work:
s = load('yourFileName.data');
If it's not a mat file, it may not work. Please attach the .dat file if you need more help. In the meantime, try to read it in with importdata() - which seems to be one of the most flexible functions. Or try dlmread(), csvread(), fileread(), textscan(), fgetl(), etc.

Categorías

Más información sobre String Parsing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by