How can I create a correlation graph

88 ビュー (過去 30 日間)
dj1du
dj1du 2022 年 5 月 30 日
コメント済み: dj1du 2022 年 5 月 31 日
Good evening!
I need to plot the correlation of a set of differently indexed vectors just like in the attached plot (I found it in a scientific publication).
By which Matlab command is it possible to create such a plot?
Thank you very much for your help!
  2 件のコメント
Mathieu NOE
Mathieu NOE 2022 年 5 月 31 日
hello
The following MATLAB® functions compute sample correlation coefficients and covariance. These sample coefficients are estimates of the true covariance and correlation coefficients of the population from which the data sample is drawn.
Function Description
corrcoef Correlation coefficient matrix
cov Covariance matrix
xcorr Cross-correlation sequence of a random process (includes autocorrelation)
The MATLAB function corrcoef produces a matrix of sample correlation coefficients for a data matrix (where each column represents a separate quantity). The correlation coefficients range from -1 to 1, where. Values close to 1 indicate that there is a positive linear relationship between the data columns.
dj1du
dj1du 2022 年 5 月 31 日
編集済み: dj1du 2022 年 5 月 31 日
Thank you very much for your answer! I don't want to be rude, but my question was rather pointed at how to create a plot like the attached one, when I already have some correlation values for each pair of vectors. I am looking for the Matlab command to create such a plot.

サインインしてコメントする。

回答 (1 件)

Chunru
Chunru 2022 年 5 月 31 日
編集済み: Chunru 2022 年 5 月 31 日
% data matrix
nv = 10; % number of variables
ns = 80; % number of samples
x = randn(ns, nv);
% Correlation coeff
r = corrcoef(x);
%imagesc(r);
imagesc(abs(r));
colorbar; axis xy
  1 件のコメント
dj1du
dj1du 2022 年 5 月 31 日
That's the command I was looking for, thank you very much!

サインインしてコメントする。

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by