create timeseries from first january to 31. December

4 Ansichten (letzte 30 Tage)
Ha Sen
Ha Sen am 14 Aug. 2018
Beantwortet: Steven Lord am 15 Aug. 2018
Hi ,
I am trying to create a vector of timeseries with only months and days. No Year! I tried a few funktions but it requires to have a year. Somehow it is difficult to not include the year.
I appreciate any help.
  1 Kommentar
dpb
dpb am 14 Aug. 2018
That's so at present, yes. Closest so far is duration class that can be such, but even it requires a year to handle calendar durations owig to leap years messing things up.
You can set the display format to not show years and pretend they're not there visually but unfortunately all coding has to include them to get comparisons, etc., to work.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Steven Lord
Steven Lord am 15 Aug. 2018
I don't believe that's possible. How many days long is the vector from January 1st to December 31st? That's a simple question, right?
The answer to that simple question depends on whether the year containing those two dates is a leap year, a non-leap year, 1712 in Sweden, or perhaps 1753 in Sweden. [I'm not really sure off the top of my head how datetime handles those last two scenarios.]

Community Treasure Hunt

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

Start Hunting!

Translated by