Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I have a script file which simply saves some variable into a .txt file format.But now i want that everytime i run the script,it must save .txt file with different name.Please help.

1 回表示 (過去 30 日間)
Hitesh Kumar
Hitesh Kumar 2017 年 11 月 18 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have a script file which simply saves some variable into a .txt file format.But now i want that everytime i run the script,it must save .txt file with different name.Please help. What i want is when i run script it saves the file as hit.txt, next time when the script is run it must save the file as hit_01.txt, and so on as hit_02.txt, hit_03.txt,etc. everytime when i run the file.

回答 (1 件)

Rik
Rik 2017 年 11 月 18 日
You can use the exist and sprintf functions to do this.
  2 件のコメント
Hitesh Kumar
Hitesh Kumar 2017 年 11 月 18 日
Please send the complete script to do so using exist or sprintf.
Rik
Rik 2017 年 11 月 18 日
Look up the documentation.
If you don't want to pay me, you will have to show you actually tried something. I do this for the fun of helping people, not for doing the work for someone else.

Community Treasure Hunt

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

Start Hunting!

Translated by