フィルターのクリア

how to find correlation coefficient ?

5 ビュー (過去 30 日間)
pruth
pruth 2016 年 3 月 11 日
コメント済み: pruth 2016 年 3 月 17 日
hello, I have a mat file, which has two columns. file attached.
I want to find a correlation coefficient between these two columns.and p-value also. and also want Plot the Pearson's linear correlation coefficients between these two.
  1 件のコメント
Muhammad Usman Saleem
Muhammad Usman Saleem 2016 年 3 月 11 日
its is a binary file.

サインインしてコメントする。

採用された回答

Muhammad Usman Saleem
Muhammad Usman Saleem 2016 年 3 月 11 日
  4 件のコメント
Muhammad Usman Saleem
Muhammad Usman Saleem 2016 年 3 月 16 日
編集済み: Muhammad Usman Saleem 2016 年 3 月 16 日
because you have not define a variable before
See this
a=[1 2 3;4 5 6] % creating a matrix
a =
1 2 3
4 5 6
A= a(:,2); % means all rows with second column of a matrix
B = a(:,3); % means all rows with third column of matrix
[R,P] = corrcoef(A,B) %cross correlation
R = % 1 showing good correl
1 1
1 1
P = %depends upon your data set NaN means no corr
1 NaN
NaN 1
hope this will be fine.
pruth
pruth 2016 年 3 月 17 日
thanks man...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by