Hey MATLAB universe!
I have a file 360 x 40 x 444 (longitude x latitude x time). These are MONTHLY temperature values. The 444 are time values ("days since 1800"). I wanted to extract seasonal mean data for each year.
Example: Winter- Dec,Jan,Feb for each year and then take a mean for each year. So technically I should get a matrix of 360 x 40 x 37 (since this data set contains monthly values from January 1982 to December 2018). I have used the following code but I get wrong values if I map them:
lon=ncread('sstarc.nc','lon');lat=ncread('sstarc.nc','lat');sst=ncread('sstarc.nc','sst');DJF = sort([[1:12:444],[2:12:444],[12:12:444]]);Wacc = cumsum(sst(:,:,DJF));Wavg = Wacc(:,:,3:3:end)/3;
I would like to know where I am going wrong. (Data file is attached and arranged as Jan-1982, Feb-1982,…Dec-2018.)
Thank you
Best Answer