I have a two long variables (+40,000 measures) of doubles x & y and i would like to calculate a third variable from them z. However X and Y are measured over time and at various depths in the ocean, not always at the same exact depths so in order to calculate my z variable i need to do some matlab wizardry?? (I have the date in every format under the sun and also separate variable for the year,month and day seperately)
I would like a code that calculates monthly averages at certain depths.
For example to go from a matrix of [date, x, y, depth] which contain various NaNs to one which has 1:20:4000 depth in the first column repeated for every month (total of 350 months in my data set) and then corresponding monthly average for x and y.
Thank you for any help with this in advance