【发布时间】:2018-03-15 00:16:33
【问题描述】:
我有这样的数据文件
2 FP1 0 9.064
2 FP1 1 6.622
2 FP1 2 4.669
2 FP1 3 3.693
2 FP1 4 3.693
2 FP1 5 3.693
2 FP1 6 4.181
2 FP1 7 4.181
2 FP1 8 5.157
2 FP1 9 6.134
2 FP1 10 7.111
2 FP1 11 7.111
2 FP1 12 5.646
2 FP1 13 4.669
2 FP1 14 3.693
2 FP1 15 4.181
其中有几个文件,我想将所有文件与这些数据连接起来;我使用了以下内容:
d=dir('*.m'); % get the list of files
x=[]; % start w/ an empty array
for i=1:length(d)
x=[x; load(d(i).name)]; % read/concatenate into x
end
save('newfile.m',x)
但是,我收到以下错误,
Error using load
Unknown text on line number 1 of ASCII file co2a0000364.rd.002.m
"FP1".
如何连接所有文件中的所有数据并包含字符 FP1 等?
【问题讨论】:
-
数据在.m文件中???
标签: matlab file concatenation