필터 지우기
필터 지우기

how to find the position of an element in a matrix

조회 수: 1 (최근 30일)
Malik
Malik 2013년 4월 24일
b =
0 0 0 0 2
0 0 0 0 3
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
i want to find the max element in the last column
c = max(b(:,5))
now how can i find the row number corresponding to this column, here i can see that it is 2 but how to compute it without knowing whats in the table.
regards

답변 (1개)

Matt J
Matt J 2013년 4월 24일
Call MAX with 2 output arguments.
  댓글 수: 2
Malik
Malik 2013년 4월 24일
how?
Matt J
Matt J 2013년 4월 24일
You are calling MAX with one output argument, c. Call it with an additional one. If you are not familiar with all the different usages of MAX, you should be reading
>> doc max

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by