Create a monthly datetime sequence
Mostrar comentarios más antiguos
Hello everyone,
Can someone please me explain why this code
a=datetime(1981,1,1);
b=datetime(2019,31,1);
t1=a:calmonths(1):b;
t2=datetime(t1,'Format','yyyy-M-d');
M=datevec(t2);
Gives me monthly dates until july 2021? Am I missing something?
Thank you!
1 comentario
t1.Format = 'yyyy-M-d' % the correct way to set the format.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Resizing and Reshaping Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!