|
fid = fopen('新建文本文档.txt');7 [; G5 y+ K ?1 q7 n
data =textscan(fid,'%s %s %s');1 Z' a, [: n0 e" m: P9 Y
a = data(1,[1,2]);( c4 G" A) L6 S8 Q
aa = cell2mat(cellfun(@(x) str2num(char(x)),a,'UniformOutput',false));
; O4 S& B) n( ~) B+ a2 J' Kb = data{:,3};
( I ]+ R/ I8 A$ L% S) `4 lc = cellfun(@(x) str2num(char(x)),b,'UniformOutput',false);3 l$ u3 M0 g o! o1 k5 n% }" e
index=cell2mat(cellfun(@(x) ~isempty(x),c,'UniformOutput',false));
3 L# e4 h2 y5 N$ J% M. O$ r7 r2 S) zresult = [aa(index,: ), vertcat(c{index})];" d9 W+ M% f/ D; m
fclose(fid); |
|