dat file

6 visualizaciones (últimos 30 días)
val chrys
val chrys el 19 de Feb. de 2011
how do I read a dat file into matlab ? i have a dat file with 5 columns of numbers and i want to read column one and column five thank you in advance
  3 comentarios
Jan
Jan el 13 de Mayo de 2011
Is message duplication a new sport?
Walter Roberson
Walter Roberson el 13 de Mayo de 2011
Matt and I did a clean-up sweep of known duplicate messages yesterday.

Iniciar sesión para comentar.

Respuestas (1)

Matt Tearle
Matt Tearle el 19 de Feb. de 2011
I'm going to assume that you're talking about a text data file. In that case, use textscan:
fid = fopen('filename.dat');
Data = textscan(fid,'%f%*f%*f%*f%f');
fclose(fid);
You may need to specify other options to textscan, depending on your file formatting (header lines, delimiters, etc).
If the file is binary, then see Walter's answer to #1632

Categorías

Más información sobre Data Import and Analysis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by