Compare two matrices and select max one based on the a column
이전 댓글 표시
I have two matrixes and I want to compare the last column. Then select the max one and the whole corresponding row.
For example
A = [ 1 , 4, 5; 1, 4, 6];
B = [2, 6, 6; 2, 5 , 9];
The next matrix based on the last column max will be
C = [2, 6, 6; 2, 5 , 9];
Anyway to help, please
채택된 답변
추가 답변 (1개)
madhan ravi
2020년 3월 17일
C = max(A,B)
댓글 수: 3
Yaser Khojah
2020년 3월 17일
편집: Yaser Khojah
2020년 3월 17일
madhan ravi
2020년 3월 17일
Illustrate the answer if the B were to be
B = [2, 6, 4; 2, 5 , 9];
Yaser Khojah
2020년 3월 17일
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!