How to use 'dir' to list files in another directory with a string
2 ビュー (過去 30 日間)
古いコメントを表示
Guys -
I have a variable that is a string describing a path (x = \\drive\folder1\folder2). How can I use 'dir' to create a list of all files in that directory without switching to the directory to do it? I've tried things like
list = dir('%s',x)
but that doesn't work.
0 件のコメント
回答 (1 件)
Azzi Abdelmalek
2013 年 11 月 8 日
編集済み: Azzi Abdelmalek
2013 年 11 月 8 日
x='E:matlab'
d = dir(x)
f={d.name}
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!