Creating a diary that is not appended to an existing one.
20 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Dave
am 9 Nov. 2017
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 Kommentare
Weitere Antworten (2)
WAT
am 30 Sep. 2015
if (exist(filename))
delete(filename);
end
4 Kommentare
Walter Roberson
am 5 Okt. 2015
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
am 30 Sep. 2015
3 Kommentare
Walter Roberson
am 30 Sep. 2015
Xiaodi
am 3 Sep. 2017
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')
Siehe auch
Kategorien
Mehr zu File Operations finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!