Dear all, I have a column matrix A and an nxn matrix B. I have been able to estimate the correlation coefficient (R) between the constant column matrix A and each column vector in matrix B using corr(A,B). However, I am finding difficulties in summing only columns with their R=>0.2, while ignoring columns with R<0.2. I will be very grateful for the assistance.

 채택된 답변

madhan ravi
madhan ravi 2019년 5월 18일
편집: madhan ravi 2019년 5월 18일

0 개 추천

sum(R(:,any(R>=.2)))

댓글 수: 3

Albert Buabeng
Albert Buabeng 2019년 5월 19일
Thanks for your quick response, this code sums the correlation coefficients instead of the nxn matrix B.
madhan ravi
madhan ravi 2019년 5월 19일
편집: madhan ravi 2019년 5월 19일
sum(B(:,any(R>=.2))) % syms B according to R satisfying the condition
Albert Buabeng
Albert Buabeng 2019년 5월 19일
It's working just as expected, thank you very much. You are a live saver.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Random Number Generation에 대해 자세히 알아보기

제품

릴리스

R2018a

질문:

2019년 5월 18일

댓글:

2019년 5월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by