天天看点

批量读取文件matlab

前言

% /************************************************************************
% * Copyright(c) 2017  Amy
% * All rights reserved.
% * File:   test.m
% * Brief: 
% * Version: 1.0
% * Author: Amy
% * Email:
% * Date:   2017/09/22
% * Reference:
% * History:
%
% ************************************************************************/
clc
clear
close all
test_path = '.\test\';
test_list = dir(strcat(test_path, '*.png'));%某类文件格式
test_number = length(test_list);%获取图像总数量
for j = 1:test_number %逐一读取图像
    image_name = test_list(j).name;% 图像名
    img = im2uint8( imread(strcat(test_path, image_name)) );
    %TODO
    
end