필터 지우기
필터 지우기

converting Excel serial number of "Time" to hh:mm:ss format

조회 수: 1 (최근 30일)
Ali Y.
Ali Y. 2011년 1월 21일
I have a problem with "time" data type, so that, I import time data from Excel to MATLAB, and it just give the Excel serial number. could you please help me to convert it to hh:mm:ss format or as string.
.
I use Matlab 2008.
.
The code is like this:
.
[num text]=xlsread('...');
time=num(:,i);

채택된 답변

Doug Hull
Doug Hull 2011년 1월 21일
>> now
ans =
7.3452e+005
>> datestr(now)
ans =
21-Jan-2011 14:50:52

추가 답변 (1개)

Walter Roberson
Walter Roberson 2011년 1월 21일
If the date is after Feb 28 1900, it appears that you will need to subtract 1 from the excel serial date to get to the serial date that matlab uses. Excel thinks that Feb 29 1900 existed, but it did not; this was apparently a deliberate design feature for compatibility with other products. Excel date description

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by