Problem with datenum usage

조회 수: 4 (최근 30일)
George
George 2014년 8월 8일
댓글: George 2014년 8월 11일
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
Andy L
Andy L 2014년 8월 8일
Minutes should be 'MM' not 'MN'

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

채택된 답변

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

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

추가 답변 (0개)

카테고리

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