DOY2DATE.m will convert a vector of day of year numbers and years
and convert them to MATLAB date format.
Sample Call:
doyV = [54;200.4315];
yearV = [2009;2009];
[dateV] = doy2date(doyV,yearV);
Inputs:
doyV -> vector of day of year numbers (n x 1)
yearV -> vector of years (n x 1)
Outputs:
dateV -> vector of MATLAB dates (n x 1)
function [dateV] = doy2date(doyV,yearV)
z = zeros(length(yearV),5);
dv = horzcat(yearV,z);
dateV = doyV + datenum(dv);
引用格式
Ashley (2024). Day of Year to MATLAB date (https://www.mathworks.com/matlabcentral/fileexchange/24235-day-of-year-to-matlab-date), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
创建方式
R2007a
兼容任何版本
平台兼容性
Windows macOS Linux类别
在 Help Center 和 MATLAB Answers 中查找有关 Dates and Time 的更多信息
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!