|
|
fid = fopen('新建文本文档.txt');6 T( v& {! h- m% }0 G& n
data =textscan(fid,'%s %s %s');
3 V. |( U k+ k2 P1 P7 va = data(1,[1,2]);3 P8 {3 f2 D/ E; n% ~2 a: M: N
aa = cell2mat(cellfun(@(x) str2num(char(x)),a,'UniformOutput',false));0 B- Z ]" t5 ^" e
b = data{:,3};" i" }4 v1 E; O9 F9 J9 A8 ^. d
c = cellfun(@(x) str2num(char(x)),b,'UniformOutput',false);
8 X. e' n/ G3 E% @. oindex=cell2mat(cellfun(@(x) ~isempty(x),c,'UniformOutput',false));
|/ A8 }4 [. T. I0 k4 b" presult = [aa(index,: ), vertcat(c{index})];
d% Y2 _2 u tfclose(fid); |
|