matlab - 从matlab中的文件读取时如何跳过前几行
问题描述
我正在从“Data.raw”文件中读取我的数据,但我对如何跳过前 2 行一无所知。我已经编写了一个从文件中读取的程序。如果您能告诉我如何跳过前几行并仅从第三行获取数据,我将不胜感激。
%Reading the Text File
fileID = fopen('Data.raw');
TSOutput = textscan(fileID,'%f %f %f %f/n' );
count = 0;
while not(feof(fileID))
count = count + 1;
readData = textscan(fileID,'%f %f %f %f/n');
if feof(fileID)
break;
end
TSOutput = [TSOutput; readData];
end
我的数据文件:
# Z TALLY_DATA 260
# L M N Y
1 1 0 -6.291667
1 1.003333 0 -0.2748109
1 1.003333 0.1 -0.2748109
1 1 0.1 -6.291667
1 1.006667 0 0.8322136
1 1.006667 0.1 0.8322136
1 1.01 0 1.501634
解决方案
推荐阅读
- angular - Angular 2+ path to static html
- java - GWT 2.7.0 with chrome version 69 not loading java source files
- c# - 以异步方法返回 Task.Run
- sql - SQL Server 将 X 行添加到结果以始终等于 5 行输出
- eclipse - Spring Tools Suite 4 下载失败,Eclipse Photon
- matlab - 如何反转 3D Barplot Matlab 中的一个轴
- html - 如何使用 CSS 在范围输入中设置最小值和最大值
- python - ^ 不支持的操作数类型:“str”和“int”异或解密
- scala - Scala案例类使用浅拷贝还是深拷贝?
- android - 前 21 个 API 设备上的改造 API 失败 javax.net.ssl.SSLProtocolException:SSL 握手中止: