Move diary in file to newfolder

14 vues (au cours des 30 derniers jours)
armin m
armin m le 6 Juil 2021
Commenté : armin m le 6 Juil 2021
Hi.I export my output file to diary file.I want each time i run the code, matlab move diary file to a newfolder and rename the folder name to date and time of running code.how can i do?

Réponse acceptée

Peter O
Peter O le 6 Juil 2021
Hi Armin,
Try this at the start of your code. You may need to ensure the path exists before creating the diary file. You should get an error if that's the case, use mkdir for the path.
mypath = 'diaries'
myfile = "mydiary_" + datestr(now,30) + ".txt"
filepath = fullfile(mypath, myfile)
diary(filepath)
% Print location of diaryfile
get(0,'DiaryFile')
  8 commentaires
Peter O
Peter O le 6 Juil 2021
Not possible, unfortunately.
armin m
armin m le 6 Juil 2021
Thank you alot

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by