Creating a diary that is not appended to an existing one.
20 ビュー (過去 30 日間)
古いコメントを表示
According to Matlab documentation when turning on the diary it appends the commands to the existing diary of the same name. Is there a way not to append, that is to start the diary file afresh? Thanks Tomy
0 件のコメント
採用された回答
Dave
2017 年 11 月 9 日
To have the diary name with the date and time when starting use this command:
diary(['gd_diary_',datestr(now,'dd-mm-yy','local'),'_',datestr(now,'hh-MM-ss','local'),'.txt'])
0 件のコメント
その他の回答 (2 件)
WAT
2015 年 9 月 30 日
if (exist(filename))
delete(filename);
end
4 件のコメント
Walter Roberson
2015 年 10 月 5 日
I would speculate that at the time you delete() that the current directory is no longer the same directory you created the diary in. Remember that it is always safer to fully-qualify file names.
Walter Roberson
2015 年 9 月 30 日
3 件のコメント
Walter Roberson
2015 年 9 月 30 日
Xiaodi
2017 年 9 月 3 日
I guess, before you delete mydiary.out file, you must
diary off
to close the diary process and then maybe you can delete this mydiary.out file, which is created by
diary('mydiary.out')
参考
カテゴリ
Help Center および File Exchange で File Operations についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!