|
fid = fopen('新建文本文档.txt');
4 w2 I j5 t6 l+ mdata =textscan(fid,'%s %s %s');2 m& C F1 f- Z8 I
a = data(1,[1,2]);7 j' B$ j4 s$ H4 A( [
aa = cell2mat(cellfun(@(x) str2num(char(x)),a,'UniformOutput',false));( d+ T' f, K0 K+ E3 M8 J1 \# z
b = data{:,3};
2 O' Q, ?: y( J' ec = cellfun(@(x) str2num(char(x)),b,'UniformOutput',false);
5 u, \) T; o' ~3 U6 iindex=cell2mat(cellfun(@(x) ~isempty(x),c,'UniformOutput',false));
, v. I. W1 N/ _( k" Vresult = [aa(index,: ), vertcat(c{index})];
4 P% w6 s4 r6 m, f. @" b$ u! pfclose(fid); |
|