Hello!
Excel file format as follows:
- A column: Year (from 1998 to 2018)
- B column: Day of the year
- C column: Hour
I'd like to convert the values of B and C column as year.
Doy= C/24+B
Formula is:
Time=A+(Doy/365) or Time=A+(Doy/366)
Dividing 365 or 366 is related to divide by 4. That's why I benefitted from modulo operation but I didn't do what I want.
data=xlsread('R.xlsx');Doy=data(:,2)+(data(:,3)/24);M = mod(data(:,1),4);j=1;for i=1:176784;if M ==0Time=data(:,1)+(Doy/366);else M~=0Time=data(:,1)+(Doy/365);j=j+1;end
Best Answer