Sum specific colums based on a criteria
1 view (last 30 days)
Show older comments
Albert Buabeng
on 18 May 2019
Commented: Albert Buabeng
on 19 May 2019
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.
0 Comments
Accepted Answer
madhan ravi
on 18 May 2019
Edited: madhan ravi
on 18 May 2019
sum(R(:,any(R>=.2)))
3 Comments
madhan ravi
on 19 May 2019
Edited: madhan ravi
on 19 May 2019
sum(B(:,any(R>=.2))) % syms B according to R satisfying the condition
More Answers (0)
See Also
Categories
Find more on Number Theory in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!