How to create a matrix of correlation values

2 ビュー (過去 30 日間)
Sawyer
Sawyer 2018 年 12 月 11 日
Hi all,
I'm a new to Matlab and only know the bascis. I have a data set with 20 x 150 columns. I need to find the correlation of the 20 values in the first column with themselves & create a matrix of size 20*20 which represents correlation of these 20 values with each other.
I've figured out the easy part, creating the 1 x 20 matrix from the loaded file: A=data(1:20);
What I can't figure out is a way to generate the 20x20 matrix representing the correlation of the 20 values with each other.
I've tried all of the following, to no avail:
corr2(A,A) % answer ends up as '1'
corr(A',A') % answer ends up as '1'
corrcoef(A,A) % results in a 2x2 matrix of '1' values)
corr(A,A) % this DOES create a 20x20 matrix, but all the values are NaN
Can someone please help me? Thanks in advance!

回答 (0 件)

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by