|
fid = fopen('新建文本文档.txt');
$ {/ R9 H/ P5 u3 b/ Odata =textscan(fid,'%s %s %s');. [1 @1 p1 R: R3 |0 U9 P' k6 e
a = data(1,[1,2]);
& d5 b, ]" A% f. u F9 `+ w0 J6 i4 ]aa = cell2mat(cellfun(@(x) str2num(char(x)),a,'UniformOutput',false));( b2 A' K. k7 {) s6 D
b = data{:,3};
0 R0 Q0 t0 A0 a, d5 n8 Qc = cellfun(@(x) str2num(char(x)),b,'UniformOutput',false);
: j. c( _! V1 o+ I6 pindex=cell2mat(cellfun(@(x) ~isempty(x),c,'UniformOutput',false));
, }2 a# H7 ~1 G) q# [0 C) _result = [aa(index,: ), vertcat(c{index})];
( c- e# f+ o4 v+ a7 hfclose(fid); |
|