I have several .mat files, which are all in a 3-D matrix of latitude x longitude x value (70 x 70 x 8760).
It looks like this: year2000.mat --> (72 x 70 x 8760), year2001.mat --> (72 x 70 x 8760),until year 2020
I need the long-term mean along the third dimensions-the value. The result should be again a .mat file with 3-Dimension (72 x 70 x 8760). The first and second dimensions don't change.
I am very new to Matlab.
you did well in loading the files but since you know all the files start with
yearyou can do:Then, you load the files, but if I understand you correctly you want to mean the years, not each year. so,
is variable really the name if the variable in each mat file? I just used what you wrote, but you should check what you get if you load a single file.
now the avg is just the sum over the
n: