3-D矩阵的几个.mat文件的平均值
我有几个.mat文件,它们全部都在纬度x经度x值的3-D矩阵中(70 x 70 x 8760)。
看起来像这样: 2000.mat-> (72 x 70 x 8760), 2001.mat-> (72 x 70 x 8760),直到2020年,
我需要沿第三维的长期平均值 - 值。结果应再次为3次(72 x 70 x 8760)的.mat文件。第一和第二维度不会改变。
我是Matlab的新手。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在加载文件方面做得很好,但是由于您知道所有文件都以
年开始
可以做:然后,您加载文件,但是如果我理解正确,您想指的是年份,而不是每个年份年。因此,
如果每个垫子中的变量中的变量,变量真的是名称吗?我只是使用了您写的内容,但是如果加载一个文件,应该检查您得到的内容。
现在,AVG只是
n
的总和:you did well in loading the files but since you know all the files start with
year
you 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
: