Opening the only file in the directory

2 ビュー (過去 30 日間)
v k
v k 2021 年 1 月 18 日
コメント済み: v k 2021 年 1 月 18 日
Hello,
I have a directory in which there is only one file with a big name string. The matlab m-file which fopens this file is in some other directory. How can I fopen this only file without explicitly writing down its name in the m-file? The reason that writing down the filename is not desirable is because there are atleast nine hundred such directories with a single file in each of them, and every filename is different. Each directory is properly numbered though - dir001, dir 002, ..., dir934. Each of these contain exactly one file. And the filetype is also the same.
Thanks.

採用された回答

Rik
Rik 2021 年 1 月 18 日
You can use the dir function.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by