xlswrite include date and time in filename
3 views (last 30 days)
Show older comments
I can use xlswrite to write to a file.
For example write matrix Datatemp1 to sheet temp in filename.xlsx the code is
xlswrite('C:\path\filename.xlsx',Datatemp1, 'temp');
I want to include the date and time of the file in the name. I'll be collecting several files across days, and do not want one to overwrite the previous file.
thanks
0 Comments
Accepted Answer
Fangjun Jiang
on 20 Aug 2011
Specify your file name such:
FileName=sprintf('FileName_%s.xlsx',datestr(now));
12 Comments
More Answers (0)
See Also
Categories
Find more on Spreadsheets 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!