批量读取文件matlab
前言
工程实现的过程中经常需要依次读取文件夹中的图像(或者其他文件),本文就对此进行实现。
代码
% /************************************************************************ % * Copyright(c) 2017 Amy % * All rights reserved. % * File: test.m % * Brief: % * Version: 1.0 % * Author: Amy % * Email: happyamyhope@163.com % * 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
完
各美其美,美美与共,不和他人作比较,不对他人有期待,不批判他人,不钻牛角尖。
心正意诚,做自己该做的事情,做自己喜欢做的事情,安静做一枚有思想的技术媛。
版权声明,转载请注明出处:https://www.cnblogs.com/happyamyhope/
心正意诚,做自己该做的事情,做自己喜欢做的事情,安静做一枚有思想的技术媛。
版权声明,转载请注明出处:https://www.cnblogs.com/happyamyhope/