String Matlab-引用文件夹中的所有图像

String Matlab-引用文件夹中的所有图像,string,image,matlab,String,Image,Matlab,我的文件夹中有1000个位图图像,我想把它们的名称放在一个字符串数组中,如下所示 ImageNameArray={'firstImage.bmp','second.bmp','third.bmp', . . . } 但是,每个图像都有自己的唯一名称。还有其他方法吗?Try,它会生成一个包含名称和其他字段的结构数组。您可以选择该字段并生成包含所有名称的单元格数组: files = dir('path\to\folder\*.bmp'); %// struct array imageNameAr

我的文件夹中有1000个位图图像,我想把它们的名称放在一个字符串数组中,如下所示

 ImageNameArray={'firstImage.bmp','second.bmp','third.bmp', . . . }
但是,每个图像都有自己的唯一名称。还有其他方法吗?

Try,它会生成一个包含
名称
和其他字段的结构数组。您可以选择该字段并生成包含所有名称的单元格数组:

files = dir('path\to\folder\*.bmp'); %// struct array
imageNameArray = {files.name}; %// cell array

这正是我需要的,谢谢