Date to Decimal Day of Year

버전 1.2.0.0 (1.62 KB) 작성자: Anthony Kendall
Convert a vector of MATLAB serial dates to decimal days since the start of the year.
다운로드 수: 4.4K
업데이트 날짜: 2009/4/28

라이선스 보기

This function calculates the decimal day of the year of the input vector of dates. The dates must be in MATLAB serial date format.

For example, for datestr(now), MATLAB produces: "18-Jan-2008 14:33:27". The output of this function, called "date2doy" yields-
date2doy(now): "18.60662".

There are two outputs, the decimal date (can be a vector), and the fraction of the year completed by that date. From the example above, the fraction of the year is: "0.0481"

This function is very fast, and is ideal for embedding in larger applications that call date2doy many times.

인용 양식

Anthony Kendall (2024). Date to Decimal Day of Year (https://www.mathworks.com/matlabcentral/fileexchange/18316-date-to-decimal-day-of-year), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2007a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.2.0.0

Submitted modified file to FEX as detailed in file description.

1.0.0.0

In response to James' review, I've heavily modified this function and taken all of his suggestions. Also, the calculation, while simple, is not as trivial as James mentions.