📄 corr.m
字号:
function rho = corr(x,y)%CORR Correlation coefficient.%% rho = corr(x,y)%% The correlation coeffient is computed between all% columns in x and all coluns in y. If only one% argument x is given then the correlation matrix% for x is returned instead.%% See also CVAR, SPEARMAN.% GPL Copyright (c) Anders Holtsberg, 1998if nargin < 2 c = cvar(x); s = sqrt(diag(c)); rho = c ./ (s*s'); n = size(x,2); rho(1:n+1:n^2) = ones(n,1);else cx = cvar(x); sx = sqrt(diag(cx)); cy = cvar(y); sy = sqrt(diag(cy)); c = cvar(x,y); rho = c ./ (sx*sy');end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -