我是靠谱客的博主 苹果白开水,这篇文章主要介绍matlab获取当前目录下的所有“txt“格式的文件名,现在分享给大家,希望可以做个参考。

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获取当前目录下内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(108)

评论列表共有 0 条评论

立即
投稿
返回
顶部