필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

set daten 1 does not work

조회 수: 1 (최근 30일)
Micky Josipovic
Micky Josipovic 2020년 5월 18일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi there,
I set 2 dates to work with a matrix(-es). During the work had to save the matrix and restart my work from a specific date.
% daten1=floor(soil(1,1));
daten1=datenum(soil(2019,12,2));
daten2=floor(soil(end,1));
but it always picks either the first date or comes with an error like:
Index in position 3 exceeds array bounds (must not exceed 1).
  댓글 수: 2
dpb
dpb 2020년 5월 18일
daten1=datenum(soil(2019,12,2));
is trying to use soil as a variable dimensioned as a 3D array with what appear to be specific year, month and day values used as indices into the array. That's probably not what intended but we don't know how you have the data stored to know just what it is for absolutely certain. It appears from the message it may be a 2D array, but likely isn't stored against indices that match years and months.
daten1=datenum(2019,12,2);
would give you a datenum corresponding to December 2, 2019 if that is what you have in mind. How to relate that to some position in the data, we really can't say without knowing how those data are stored.
It would be better to get away from using the deprecated datenum and switch to the datetime class for new work; it has many features including integrated support by plotting routines that make it far more convenient in the end.
Micky Josipovic
Micky Josipovic 2020년 5월 18일
Thanks for sending me your answer. I will attend to this issue later.
Micky

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by