提取符合条件文件名和后缀的文件
fileFolder = fullfile(matlabroot,'mathclass','raccoon'); % 遍历文件夹下所有符合条件的文件
dirOutput = dir(fullfile(fileFolder,'ra*.jpg')); % 提取路径
fileNames = {dirOutput.name}'; % 获得符合条件文件名
删除后缀
在M文件中载入了一个知道路径而不知道名字的txt文件,
load abc.txt
怎样才能把abc这个名字(不要.txt后缀)提取出来赋给某个变量,请高手指教,谢谢!
filename='abc.txt'
filename =
abc.txt
>> new=filename(1:end-4)
new =
abc
此文转