我有两个1或-1的数字向量在Matlab上有哪些标准工具可以帮助我计算两个向量之间的相关数提前谢谢!
最佳答案
CORRCOEF函数是您要查找的:
R = corrcoef(vector1(:),vector2(:)); %# Returns a 2-by-2 matrix of
%# correlation coefficients
如果您有Statistics Toolbox,您可能还想查看函数CORR:
RHO = corr(vector1(:),vector2(:)); %# Returns the linear correlation coefficient
%# (default is a Pearson correlation)