|
fid = fopen('新建文本文档.txt');1 ^ _+ ~( G" ]! b; d. d
data =textscan(fid,'%s %s %s');9 N {% F- V* p8 @0 P. A1 F
a = data(1,[1,2]);8 }# U. l2 l6 h
aa = cell2mat(cellfun(@(x) str2num(char(x)),a,'UniformOutput',false));
/ O$ O: `3 k/ a7 nb = data{:,3};
" h, i3 w7 F9 N* r% i; \$ cc = cellfun(@(x) str2num(char(x)),b,'UniformOutput',false);
2 [. b, z. q3 x# _# F+ Cindex=cell2mat(cellfun(@(x) ~isempty(x),c,'UniformOutput',false));
+ H! g; x0 ]8 [7 W+ N. wresult = [aa(index,: ), vertcat(c{index})];
$ x) |" ?% v; Q" b% s+ m# Rfclose(fid); |
|