How can I save the MATLAB Command Window output to a text file?
Show older comments
How can I save the MATLAB command window output to a text file?
Accepted Answer
More Answers (1)
laurent jalabert
on 10 Feb 2021
Edited: laurent jalabert
on 10 Feb 2021
0 votes
diary_name = strcat(datestr(now),'_diary.txt');
diary_folder = pwd;
diary(diary_name)
disp(datestr(now))
diary off
(I am not sure diary off will stop the currently running diary(diary_name) ...)
It will be nice to write like this :
diary(diary_folder, diary_name,'on')
diary(diary_folder,diary_name,'off')
Categories
Find more on Entering Commands in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!