Append current date to filename
이전 댓글 표시
Hello everyone,
I have a simulink code which writes a structure called 'state' to the workspace containing multiple outputs which I would like to save to a .mat file by running a post processing script, eventually through a callback function. I am currently trying to append the current time and date to the output file. I have gotten the file to save in the specified location but have been unable to append the current date/time to the file name. I have included the path because I would like to save the output files to their own folder, not simply the current folder.
This was my latest attempt..
Any help would be appreciated.
Cheers!
t = datetime('now', 'Format','yyyy_MM_dd,HH_mm');
DateString = datestr(t)
FileName=[DateString,' Output ','JohnSmith']
save('/Users/John/Desktop/Project1/Matlab Model/'FileName,'state')
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Naming Conventions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!