date to date month calculation coding

조회 수: 6 (최근 30일)
Shanmuganathan Chelladurai
Shanmuganathan Chelladurai 2018년 10월 5일
댓글: jonas 2018년 10월 5일
input:
starting date: 01/01/2018
End date: today
output:
no. of month calculation: 9
_How to insert coding in M.file matlab
  댓글 수: 1
jonas
jonas 2018년 10월 5일
have you even read the answer?

댓글을 달려면 로그인하십시오.

답변 (1개)

jonas
jonas 2018년 10월 5일
편집: jonas 2018년 10월 5일
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

카테고리

Help CenterFile Exchange에서 Calendar에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by