How to use one matrix to constrain another matrix of the same size?
Show older comments
I am doing pairwise correlation analysis and ran into the following problem. I have a n by n matrix of p values and a corresponding n by n matrix of r. I want to keep every entry in the r matrix that has a p value less than 0.01, and make all the other entry either 0 or NaN. In other words, I have matrix A and B; if Ai,j then keep Bi,j; if Ai,j=0.01, then Bi,j=0. Can someone please help me with how to code this? Thank you!!
Accepted Answer
More Answers (0)
Categories
Find more on NaNs 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!