matlab相关性分析(皮尔逊,肯德尔,斯皮尔曼)

代码:

clc;
clear;


load('CRO-C3.mat')
data=[GPP_DT_VUT_REF,EVI,NDVI,NIRv,kNDVI,LSWI,FPAR,TA_F,VPD_F,SW_IN_F];

rho = corr(data, 'type','pearson');
% rho = corr(data, 'type','Spearman');
% rho = corr(data, 'type','Kendall');

string_name={'GPP','EVI','NDVI','NIRv','kNDVI','LSWI','FPAR','TA','VPD','SW'};
xvalues = string_name;
yvalues = string_name;

h = heatmap(xvalues,yvalues, rho, 'FontSize',10,'FontName','Times New Roman');
H.Title = 'pearson 相关系数矩阵';
colormap summer

结果:

matlab相关性分析(皮尔逊,肯德尔,斯皮尔曼)_第1张图片

参考资料:

https://zhuanlan.zhihu.com/p/449099421

https://ww2.mathworks.cn/help/matlab/ref/heatmap.html

你可能感兴趣的:(日常笔记,matlab)