How to find index of cell array
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a cell array of
A = [2] [4] [5] [7]
[3] [10] [1] [9]
its index is given by code
[maxval idx] = max([imp{:}])
Above code is giving
maxval = 10
index = 4
whereas I want result as index = 6 (row wise calculation)
Please help
댓글 수: 3
the cyclist
2017년 1월 24일
Vishal, perhaps more to the point is that you are asking many extremely basic questions, but not understanding the "big picture" of how the answers relate to each other.
You will be better off learning the fundamentals of MATLAB. There are many free resources for that. For example, you could start here.
If you do not learn the fundamentals, you will forever be reliant on this forum for every tiny question.
채택된 답변
Takuji Fukumoto
2017년 1월 25일
How about using transposition?
B=A';
[maxval idx] = max([B{:}])
You can get
maxval =
10
idx =
6
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!