How do I add date and time to my exel filename
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
filename = strcat('Solution_',date,'.xlsx'); sheet = 1; xlRange = 'A3'; xlswrite(filename,transpose(P),sheet,xlRange) xlRange = 'B2'; xlswrite(filename,T,sheet,xlRange) xlRange = 'B3'; xlswrite(filename,n_max_Methanol,sheet,xlRange)
It is working like this with an Date but i can t get it to work with date and ime in the Title, when I suplement date with datetime it says : "Comparison is not defined between datetime and double arrays."
0 Commenti
Risposte (1)
Alexandra Harkai
il 25 Ott 2016
This produces an 'ugly' filename but it gets through the datetime->char conversion:
filename = strcat('Solution_',datestr(datetime),'.xlsx')
You can specify a format using underscore instead of the space, for example:
filename = strcat('Solution_',datestr(datetime,'dd-mmm-yyyy_HH:MM:SS'),'.xlsx')
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!