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.

类别

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