本文介绍了相关矩阵MATLAB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您知道一个matlab脚本,该脚本获取一组数据的相关矩阵,例如column = 7的numbe和row = n >> 7的行
Do you know a matlab script that gets the correlation matrix of a set of data like numbe of columns=7, and rows = n>>7
x1 x2 x3 x4 x5 x6 x7
0.780 2.042 2.754 2.894 5.000 5.000 5.000
0.767 0.816 2.758 2.898 5.000 1.644 1.626
0.816 0.836 1.558 2.124 2.952 5.000 5.000
0.848 0.871 1.588 2.147 2.966 5.000 5.000
1.378 1.620 1.433 2.567 3.268 3.203 5.000
....
推荐答案
尝试 corrcoef
.
通常,您可以通过搜索在线帮助来立即找到这些东西,例如通过方便的lookfor
命令:
In general, you can find these sort of things immediately by searching the online help, for example via the convenient lookfor
command:
>> lookfor correlation
corrcoef - Correlation coefficients.
msfuncorr - an M-S-function which performs auto- and cross-
...
>> help corrcoef
CORRCOEF Correlation coefficients.
R=CORRCOEF(X) calculates a matrix R of correlation coefficients for
an array X, in which each row is an observation and each column is a
variable.
例如
load file.txt
result= CORRCOEF(file);
这篇关于相关矩阵MATLAB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!