Determine the element's row and column position based on the specific element

10 views (last 30 days)
Hello,
The project asked to output the highest value of a (value 8), with b and c being the row and column of said value. I'm having trouble finding the input that would output the b and c value, which in term determine the position of the highest value, in this case b(2) and c(C). If anyone can show me the correct inputs it'll be much appreciated!
For reference:
a= [1 3; 4 8; 2 6]
b= [1;2;3]
c= {'A' 'B' 'C'}

Accepted Answer

KALYAN ACHARJYA
KALYAN ACHARJYA on 9 Feb 2021
Edited: KALYAN ACHARJYA on 9 Feb 2021
Is this?
a= [1 3; 4 8; 2 6]
b= [1;2;3]
c= {'A','B','C'}
[r1,c1]=find(max(a(:))==a)
b(r1)
c{c1}

More Answers (0)

Tags

Products

Community Treasure Hunt

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

Start Hunting!