date to date month calculation coding

6 vues (au cours des 30 derniers jours)
Shanmuganathan Chelladurai
Commenté : jonas le 5 Oct 2018
input:
starting date: 01/01/2018
End date: today
output:
no. of month calculation: 9
_How to insert coding in M.file matlab
  1 commentaire
jonas
jonas le 5 Oct 2018
have you even read the answer?

Connectez-vous pour commenter.

Réponses (1)

jonas
jonas le 5 Oct 2018
Modifié(e) : jonas le 5 Oct 2018
dt = caldiff([datetime(2018,1,1);datetime('today')])
dt =
calendarDuration
-9mo -4d
and if you want to extract the month only
calmonths(dt)
ans =
-9

Catégories

En savoir plus sur Calendar dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by