MATLAB: How to convert the sequential day of the year and year to normal year, month, and day format in MATLAB 7.9 (R2009b)


I have my date stored in Julian date format. I.e. I have the sequential day of the year (For example 251th day) and year. I want to convert this to normal date so that I can use it for other purposes. How can I do that in MATLAB 7.9 (R2009b)?

Best Answer

  • The attached function 'julian2date' accepts two inputs, 'seqday' & 'year', that is converted to the general 'year', 'month', and 'day' format. Download and store the attachment in a location that is in MATLAB path. You can access this function similar to the command below:
    [year month day] = julian2date(34,2010)