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