필터 지우기
필터 지우기

How to find the index of the element of a cell array which has the maximum size

조회 수: 6 (최근 30일)
for a = 1:10
x{a} = xlsread(fileName, a, range);
end
or simply take example of a cell array in this form
A = [1] [4] [6] [1 ] [5] [7]
How to find the index max value of A (i.e.A={2,3})

답변 (1개)

the cyclist
the cyclist 2017년 1월 24일
If I understand your question, I think you want
[maxVal idx] = max([A{:}])
The maximum values is maxVal, and idx is the location you want.
  댓글 수: 2
Vishal Sharma
Vishal Sharma 2017년 1월 24일
I want answer in form of row and col of max value....
the cyclist
the cyclist 2017년 1월 24일
maxVal = max([A{:}])
[row col] = find(cell2mat(A) == maxVal)
Why are you storing this as a cell array, when it has all numeric values?

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by