|
|
fid = fopen('新建文本文档.txt');" @/ z: m6 ^7 J! p" Z e! b
data =textscan(fid,'%s %s %s');
/ C; _/ d# T4 u/ ba = data(1,[1,2]);0 h# W3 Y2 p% G3 J6 Z
aa = cell2mat(cellfun(@(x) str2num(char(x)),a,'UniformOutput',false));
. h: W' z- T# ?% T2 Ib = data{:,3};4 `9 j' V u% D; K) H: b
c = cellfun(@(x) str2num(char(x)),b,'UniformOutput',false);
/ h1 X0 N V* q5 o O' D6 qindex=cell2mat(cellfun(@(x) ~isempty(x),c,'UniformOutput',false));
8 I- `0 X" J0 [. a7 t6 Mresult = [aa(index,: ), vertcat(c{index})];
( P k+ T+ I* f0 Ofclose(fid); |
|