How to find a corresponding matrix value
Show older comments
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.
Accepted Answer
More Answers (1)
BOB MATHEW SYJI
on 17 Sep 2020
Hope this helps. yis the required vector
W=%your vector
Q=%vector obtained after operations on W
[v,u]=max(W')
for i=1:length(u)
y(i)=Q(i,u(i));
end
Categories
Find more on Loops and Conditional Statements 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!