필터 지우기
필터 지우기

converion of a date

조회 수: 1 (최근 30일)
AA
AA 2015년 9월 25일
댓글: Star Strider 2015년 9월 26일
hi, how can i convert this date Thu, Sep-24-15 to a serial date number.
thanks

채택된 답변

Star Strider
Star Strider 2015년 9월 26일
This should work:
date_num = cellfun(@(x)datenum(x, 'ddd, mmm-DD-YY'), check123);
  댓글 수: 2
AA
AA 2015년 9월 26일
cellfun(@(x)datenum(x, 'ddd, mmm-DD-YY'), check123(~cellfun('isempty',check123)));
with empty lines u can use the above, thanks bro
Star Strider
Star Strider 2015년 9월 26일
My pleasure.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Walter Roberson
Walter Roberson 2015년 9월 25일
datenum('Thu, Sep-24-15', 'ddd, mmm-DD-YY')

AA
AA 2015년 9월 26일
i used this code
>> date_num = cellfun(@datenum, check123, 'ddd, mmm-DD-YY');
check 123 is a cell array with one column of the dates in the format 'ddd, mmm-DD-YY'. I get the error message Input #3 expected to be a cell array, was char instead.
how can i correct this error?

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by