MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   Matlab:相关数 (https://www.labfans.com/bbs/showthread.php?t=23796)

poster 2019-12-10 20:48

Matlab:相关数
 
我有2个数字,分别为1或-1。 Matlab上有哪些标准工具可以帮助我计算两个向量之间的相关数?提前致谢!



[B]回答:[/B]

您需要的是[URL="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/corrcoef.html"]CORRCOEF[/URL]函数:

R = corrcoef(vector1(:),vector2(:)); %# Returns a 2-by-2 matrix of %# correlation coefficients 如果您具有[URL="http://www.mathworks.com/access/helpdesk/help/toolbox/stats/"]统计工具箱[/URL] ,则可能还需要检出[URL="http://www.mathworks.com/access/helpdesk/help/toolbox/stats/corr.html"]CORR[/URL]函数:

RHO = corr(vector1(:),vector2(:)); %# Returns the linear correlation coefficient %# (default is a Pearson correlation)

[url=https://stackoverflow.com/questions/3507669]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 03:07

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.