필터 지우기
필터 지우기

Incorrect number or types of inputs or outputs for function 'dateshift'.

조회 수: 3 (최근 30일)
piero
piero 2023년 8월 15일
댓글: piero 2023년 8월 15일
HI, I WANT TO DO THIS:
2021 ****
2022 ****
but it give me error
dateshift(c,'start','year')
>> class(c)
ans =
'timetable'

답변 (1개)

Walter Roberson
Walter Roberson 2023년 8월 15일
편집: Walter Roberson 2023년 8월 15일
Do you actually need to change the time entries, or do you just need to have them display as years?
Changing the time entries could give challenges if it ended up with duplicate row times.
If you just want to change the display then,
c.Properties.RowTimes.Format = 'uuuu';
If you need to change the actual times then
c.Properties.RowTimes = dateshift(c.Properties.RowTimes, 'start', 'year');
Note that shifting to the start of the year is not enough to change the display to be just year.
  댓글 수: 3
piero
piero 2023년 8월 15일
편집: piero 2023년 8월 15일
thanks correct...in the table of year i solve with problem with : c.Properties.RowTimes.Format = 'uuuu';
instead in the array of months I want to change it like this
from
01-Jan-2022 -3908.5
01-Feb-2022 10274.5
01-Mar-2022 10496.75
01-Apr-2022 12027.25
01-May-2022 6304.5
to
31-01-2022 xxx
20-02-2022 xxx
i try code:
c1 = dateshift(c1.Properties.RowTimes, 'start', 'month');
but i don't see any difference
piero
piero 2023년 8월 15일
i solve it
c1 = dateshift(b.Properties.RowTimes ,'end', 'month');
A=table;
A.Date=c1;
A.Prof=b.Profit;
thank you

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by