matlab获取当前目录下的所有"txt"格式的文件名,案例如下:
dirList = dir(".");
file_name = string();
count = 1;
for i = 1:length(dirList)
tmp_name = dirList(i).name;
isDir = dirList(i).isdir;
if isDir == 1
continue
end
if tmp_name(end-2:end)=="txt"
file_name(count,1) = tmp_name;
count = count + 1;
end
end
最后
以上就是苹果白开水最近收集整理的关于matlab获取当前目录下的所有“txt“格式的文件名的全部内容,更多相关matlab获取当前目录下内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复