Time stamp using xlswrite
조회 수: 1 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2012년 10월 18일
편집: Azzi Abdelmalek
2012년 10월 18일
clox=cellstr(datestr(now))
xlswrite('d:\repeati.xlsx',clox,'E5:E5');
댓글 수: 2
Azzi Abdelmalek
2012년 10월 18일
편집: Azzi Abdelmalek
2012년 10월 18일
because datestr(now) is considered as an array of string
Zargham Ali
2015년 7월 20일
편집: Zargham Ali
2015년 7월 20일
@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
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!