matlab读取数据并操作

matlab读取数据并操作

M2=[]
fid = fopen('2020-12-27-16-19-52.txt');
tline = fgetl(fid);
k=1;
while ischar(tline)
    %disp(tline)
    
    
    S = regexp(tline, 's+', 'split');
    %disp(S(2))
    %M2(k)=str2num(cell2mat(S(2)));
    data_cell=S(2);
    %M2(k)=d1;
    %class(data_cell);
    
    data_double=transpose(str2num(cell2mat(data_cell)));
    %M2(M2,k)=data_double;
    
    M2=[M2 data_double];
    
    tline = fgetl(fid);
    
    
    
    
    k=k+1;
end
fclose(fid);

M2
QQ 3087438119
原文地址:https://www.cnblogs.com/herd/p/14462301.html