MATLAB: How do you convert Month/Day to Julian Day

date conversionjuliantime

I need to convert [yyyy MMM dd (hh mm ss)] into 3-digit (decimal) julian day, but every function I try takes numbers 1-31 (for dd "day") and doesn't increment the month, so julian day output is always less than 32. I need the ability to use the "MMM" portion…
I do not have major toolboxes (i.e. one solution requires the Financial Toolbox, not viable for me)
There is a solution I have by adding monthly # of days, but I'm not sure how to account for LEAP years (when # of days in February changes).
Output should be 001-365 (with floating decimal)

Best Answer

I figured it out. Had to use:
julianday = hms2h(hr,min,sec) + day;
Can check by creating a matrix
greg2(julianday-1, year);