Move diary in file to newfolder

27 次查看(过去 30 天)
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?

采纳的回答

Peter O
Peter O 2021-7-6
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 个评论
Peter O
Peter O 2021-7-6
Not possible, unfortunately.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Entering Commands 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by