Filter löschen
Filter löschen

Problem with datenum usage

2 Ansichten (letzte 30 Tage)
George
George am 8 Aug. 2014
Kommentiert: George am 11 Aug. 2014
Hi
I am trying to use the datenum function of matlab to convert into dates I read through the manual in matlab andhave used
Time = datenum(num2str(time),'yyyymmdd');
which works but when i change it to also register the Hours and Minutes in failed
time = A(:,1);
Time = datenum(num2str(time),'yyyymmddHHMN');
S.Time=Time
DATENUM failed.
Error in SWAN2buoy (line 29)
Time = datenum(num2str(time),'yyyymmddHHMN');
Caused by:
Error using cnv2icudf (line 131)
Unrecognized minute format. Format string: yyyymmddHHMN.`
have to say that I am using datenum to read timeseries from a file i have, and i would like to have it it a full timeseries form The original uploaded date format is
2.010010100300000e+07
thank you
  1 Kommentar
Andy L
Andy L am 8 Aug. 2014
Minutes should be 'MM' not 'MN'

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Iain
Iain am 8 Aug. 2014
Its a typo:
'yyyymmddHHMN'
MN should be MM
  14 Kommentare
Iain
Iain am 11 Aug. 2014
It fails when two numbers are given to it. I don't know why.
George
George am 11 Aug. 2014
thank you everybody for your help :) !

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

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

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by