create timeseries from first january to 31. December

4 visualizaciones (últimos 30 días)
Ha Sen
Ha Sen el 14 de Ag. de 2018
Respondida: Steven Lord el 15 de Ag. de 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 comentario
dpb
dpb el 14 de Ag. de 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.

Iniciar sesión para comentar.

Respuestas (1)

Steven Lord
Steven Lord el 15 de Ag. de 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.]

Categorías

Más información sobre Calendar en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by