Getting all file names at a given folder name

2020-03-01 09:49发布

How can I get the names of files in a given folder name at Matlab?

2条回答
做个烂人
2楼-- · 2020-03-01 10:23

You should use the dir function. Like so:

allFiles = dir( 'c:\my\folder' );
allNames = { allFiles.name };
查看更多
狗以群分
3楼-- · 2020-03-01 10:23

If you're on linux you can call the find command and process the output. find allows for much more advanced features than just using dir, and can be called using system('find path').

查看更多
登录 后发表回答