dat file
12 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Matt Tearle
2011-2-19
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!