Azzera filtri
Azzera filtri

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

3 visualizzazioni (ultimi 30 giorni)
HI, I WANT TO DO THIS:
2021 ****
2022 ****
but it give me error
dateshift(c,'start','year')
>> class(c)
ans =
'timetable'

Risposte (1)

Walter Roberson
Walter Roberson il 15 Ago 2023
Modificato: Walter Roberson il 15 Ago 2023
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 Commenti
piero
piero il 15 Ago 2023
Modificato: piero il 15 Ago 2023
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 il 15 Ago 2023
i solve it
c1 = dateshift(b.Properties.RowTimes ,'end', 'month');
A=table;
A.Date=c1;
A.Prof=b.Profit;
thank you

Accedi per commentare.

Categorie

Scopri di più su Tables in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by