path = 'E:\Tools'; % 目录名 Allfiles = dir( path ); FileCount = length( Allfiles ); for i = 1 : FileCount if( Allfiles( i ).isdir == 0 ) % 如果为1是文件夹,0是文件 tempfile = fullfile( path, Allfiles( i ).name ); tempimage = imread( tempfile ); % 对图像进行的操作 end end
path = 'E:\Tools'; % 目录名 Allfiles = dir( path ); FileCount = length( Allfiles ); for i = 1 : FileCount if( Allfiles( i ).isdir == 0 ) % 如果为1是文件夹,0是文件 tempfile = fullfile( path, Allfiles( i ).name ); tempimage = imread( tempfile ); % 对图像进行的操作 end end