在MATLAB中查看文件夹(包括子文件夹)中的.m文件 [英] view .m files in a folder (including subFolders) in MATLAB

查看:707
本文介绍了在MATLAB中查看文件夹(包括子文件夹)中的.m文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目文件夹内有一个文件夹要素 (全部在MyDocuments / Matlab中)。我需要文件夹要素中的所有.m文件的列表。因素有subFolders,这些子文件夹保存所有的.m文件。任何建议?



目录设计 - >

 项目... 
因子... etc
subFol1(有.m文件)
subFol2(有.m文件)
...
/ pre>

解决方案

我已经解决了类似的问题。在Windows平台上,像这样:

  pathName ='.... \FACTORS';%您的路径
[stat path] = dos(['dir'pathName'\ * .m / s / B> path.txt']);
name = importdata(path.txt);
删除path.txt

现在,您可以看到符合条件的所有文件单元格数组Name


I have a Folder Factors inside Project folder. (all inside MyDocuments/Matlab). I need the list of all .m files in the folder FACTORS. Factors has subFolders and these subFolders hold all the .m files. Any suggestions?

Directory Design ->

Project...
    Factors ... etc
       subFol1 (has .m files)
       subFol2 (has .m files)
    ...

解决方案

I have solved a similar problem.On Windows platforms, ,Like this:

pathName='.... \FACTORS';%your path
[stat path]=dos(['dir ' pathName '\*.m /s /B >path.txt'] );
name=importdata('path.txt');
delete path.txt

Now,you can see all files which matches the conditions is in the cell array "Name"

这篇关于在MATLAB中查看文件夹(包括子文件夹)中的.m文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆