MATLAB Answers

How to calculate correlation coefficient between two 3-d matrices?

113 ビュー (過去 30 日間)
Sagar 2014 年 5 月 23 日
コメント済み: Sagar 2017 年 10 月 10 日
This is often required in analyzing climate data from netcdf files. Climate variables are stored in 3-d matrix (lat, lon, time). I want to find correlation coefficient between two 3-d matrices at each grid cell (i.e. correlation along time or 3rd dimension). Is there an easier way to do this, without reshaping, for geometric intuition of the grid map? Also how to get the p-value at each grid cell after calculating the correlation?

  0 件のコメント


回答 (2 件)

André Gadêlha
André Gadêlha 2017 年 10 月 10 日
Hi, Sagar.
Did you understand? I have got the same problem with netcdf analysis. How can I do it?
Best Regards,

  1 件のコメント

Sagar 2017 年 10 月 10 日
There is no way to do it directly. You must reshape the matrix and convert to vectors. After that you can calculate correlations in a loop.


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by