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

조회 수: 22 (최근 30일)
Sagar
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?

답변 (2개)

Adapa Bhagyaraja
Adapa Bhagyaraja 2015년 8월 10일
Hello Sagar, There is a question similar to this. Check answer at http://in.mathworks.com/matlabcentral/answers/15884-correlation-for-multi-dimensional-arrays

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
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 NetCDF에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by