【发布时间】:2020-10-03 19:55:31
【问题描述】:
我有 1x252 矩阵和 13x252 矩阵。我需要使它们匹配,以便我可以使用 corrcoef 找到相关系数。不完全确定如何使用该函数,并且我有一段时间没有做过很多matlab。
【问题讨论】:
标签: matlab matrix size correlation coefficients
我有 1x252 矩阵和 13x252 矩阵。我需要使它们匹配,以便我可以使用 corrcoef 找到相关系数。不完全确定如何使用该函数,并且我有一段时间没有做过很多matlab。
【问题讨论】:
标签: matlab matrix size correlation coefficients
如果没有关于如何在矩阵中配置数据的更多详细信息,这就是我想出的。在本例中,该脚本使用repmat() 函数重复/复制Matrix_1 的行。
%Random data sets%
Matrix_1 = rand(1,252);
Matrix_2 = rand(13,252);
%Repeating the rows of x to match the number of rows in y%
Matrix_1 = repmat(Matrix_1,13,1);
Correlation_Coefficients = corrcoef(Matrix_1,Matrix_2);
Correlation_Coefficients
使用 MATLAB 版本:R2019b
【讨论】: