Saving a variable at every run

4 vues (au cours des 30 derniers jours)
Ayobami Meadows
Ayobami Meadows le 4 Fév 2022
Modifié(e) : Stephen23 le 4 Fév 2022
Assuming I've got to perform 10 runs and each run has 50 iterations. And there is a BestResult produced at a particular iteration in each run. I need to save these BestResult automatically at each run.
save BestResult
However, using the above would only save for one last run by overwriting those previously saved. Perhaps if there's a way it could by itself index the file name saved, so that the previous wouldn't be overwritten?
  2 commentaires
KSSV
KSSV le 4 Fév 2022
Show us your code.
Stephen23
Stephen23 le 4 Fév 2022
Modifié(e) : Stephen23 le 4 Fév 2022
"Perhaps if there's a way it could by itself index the file name saved, so that the previous wouldn't be overwritten?"
Of course, this is trivial using SPRINTF, just as the documentation shows:

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by