导入数据

common_path = 'D:\machine_learning\data_simulation\data_temp_all\data_all\';
flag = 0; %µ±Îª0ʱ£¬´ú±íÒ»´Î»¹Ã»Ö´ÐÐ
tag = 0; %µ±Îª0ʱ£¬±íʾdata´Ëʱ»¹Îª¿Õ
 
 
for i=1:3
    i_str = num2str(i);
    
    for m=1:7
        m_str = num2str(m);
        s5 = i_str;
        path_fifth = strcat(s5,m_str);
        
        for j=1:6
            j_str = num2str(j);
            s3 = path_fifth;
            path_third = strcat(s3,j_str);
            s4 = 'S';
            path_fourth = strcat(path_third,s4);
            
            for k=1:6
                k_str = num2str(k);
                s1 = path_fourth;
                path_first = strcat(s1,k_str);
                s2 = '3_p.txt';
                path_second = strcat(path_first,s2);
                path_final = strcat(common_path,path_second);
                original_data = importdata(path_final);
                temp_data = original_data.data(:,[2 3]);
                if flag == 0
                    data_antenna = temp_data;
                    flag = 1;
                else
                    data_antenna = cat(3, data_antenna, temp_data) ;
                end
                             
            end
            
            if tag == 0
                data = data_antenna;
                tag = 1;
                print_data = data
            else
                data = cat(4, data, data_antenna) ;
            end
                        
            flag = 0;
            
        end
    end
end

你可能感兴趣的:(机器学习导入数据,学校)