Time stamp using xlswrite

5 visualizzazioni (ultimi 30 giorni)
Tim
Tim il 18 Ott 2012
Modificato: Zargham Ali il 20 Lug 2015
Hi all,
I want to put a time stamp next to the data that I export to excel. Hence, I did this:
clox=datestr(now)
xlswrite('d:\repeati.xlsx',clox,'E5:E5');
However, this will just display a '1' in my excel file. What am I doing wrong?
Cheers, T.

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 18 Ott 2012
Modificato: Azzi Abdelmalek il 18 Ott 2012
clox=cellstr(datestr(now))
xlswrite('d:\repeati.xlsx',clox,'E5:E5');
  2 Commenti
Azzi Abdelmalek
Azzi Abdelmalek il 18 Ott 2012
Modificato: Azzi Abdelmalek il 18 Ott 2012
because datestr(now) is considered as an array of string
Zargham Ali
Zargham Ali il 20 Lug 2015
Modificato: Zargham Ali il 20 Lug 2015
@AzziAbdelmalek What to do if we need multiple timestamps on hourly basis? %start time stime=datenum(2012,1,2,0,0,0) %end time etime=datenum(2012,1,2,23,00,00) %length of time step (1D, 3min in this case) delta=datenum(0,0,0,1,0,0) %ymdhms for nw=stime:delta:etime clox=cellstr(datestr(nw))
end xlswrite('MERRA.xlsx',clox,'Sheet1','A2');
it just gives me the last hour that is 23:00.
I would be very grateful for your help. Regards

Accedi per commentare.

Più risposte (1)

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by