MATLAB: How to find a corresponding matrix value

matrix

I have two matricies, Q and W, and I calculated the values of Q from the values of W. I then found the maximum values of each row in Q, but I also need to find the corresponding values of W from the other matrix and I'm not sure how to do that.

Best Answer

You can get the corresponding values in W as follows
[mQ,idx] = max(Q,[],2,'linear')
W(idx)