Can anyone help me with this error?

조회 수: 18 (최근 30일)
Pul
Pul 2021년 8월 7일
편집: Pul 2021년 8월 8일
Hello everyone,
I can't go on because I get this error: "Error using datetime (line 647). Could not recognize the date/time format of '0'. You can specify a format using the 'InputFormat' parameter. If the date/time text contains day, month, or time zone names in a language foreign to the 'en_US' locale, those might not be recognized. You can specify a different locale using the 'Locale' parameter."
Thank you very much.

채택된 답변

Dave B
Dave B 2021년 8월 7일
giuliayearlyDELTA2.Year is a char array, so giuliayearlyDELTA2.Year(1) is '0', and you're calling datetime on that value.
Some options (I didn't look at the rest of your code so not sure where you're headed):
Option 1, call datetime on the row of chars:
xstart = datetime(giuliayearlyDELTA2.Year(1,:))
Option 2, convert the table variable to datetime and then index the first item
giuliayearlyDELTA2.Year=datetime(giuliayearlyDELTA2.Year);
xstart = giuliayearlyDELTA2.Year(1);
Option 3, convert the table variable to string, then call datetime on the first item:
giuliayearlyDELTA2.Year=string(giuliayearlyDELTA2.Year);
xstart = datetime(giuliayearlyDELTA2.Year(1));

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by