Filter löschen
Filter löschen

converion of a date

1 Ansicht (letzte 30 Tage)
AA
AA am 25 Sep. 2015
Kommentiert: Star Strider am 26 Sep. 2015
hi, how can i convert this date Thu, Sep-24-15 to a serial date number.
thanks

Akzeptierte Antwort

Star Strider
Star Strider am 26 Sep. 2015
This should work:
date_num = cellfun(@(x)datenum(x, 'ddd, mmm-DD-YY'), check123);
  2 Kommentare
AA
AA am 26 Sep. 2015
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 am 26 Sep. 2015
My pleasure.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Walter Roberson
Walter Roberson am 25 Sep. 2015
datenum('Thu, Sep-24-15', 'ddd, mmm-DD-YY')

AA
AA am 26 Sep. 2015
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?

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by