changing path in a for loop?

I am trying to use a for loop for doing some task in different folders. So, I use the cd command to change the current path in each iteration. But I realized that the path to be put in the cd command can't be a variable. How could I deal with that?

2 件のコメント

Stephen23
Stephen23 2020 年 12 月 27 日
編集済み: Stephen23 2020 年 12 月 27 日
"...the path to be put in the cd command can't be a variable"
Of course it can be:
But the much better approach is to use absolute/relative filenames rather than slow and difficult-to-debug cd. All MATLAB functions that read/write data files work with absolute/relative filenames.
Abdelrahman Taha
Abdelrahman Taha 2020 年 12 月 27 日
thanks a lot!

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

質問済み:

2020 年 12 月 27 日

コメント済み:

2020 年 12 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by