Effacer les filtres
Effacer les filtres

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

6 vues (au cours des 30 derniers jours)
Vishal Sharma
Vishal Sharma le 24 Jan 2017
Commenté : the cyclist le 24 Jan 2017
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})

Réponses (1)

the cyclist
the cyclist le 24 Jan 2017
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 commentaires
Vishal Sharma
Vishal Sharma le 24 Jan 2017
I want answer in form of row and col of max value....
the cyclist
the cyclist le 24 Jan 2017
maxVal = max([A{:}])
[row col] = find(cell2mat(A) == maxVal)
Why are you storing this as a cell array, when it has all numeric values?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by