Getting element row and column (index location) out of a matrix?

40 visualizaciones (últimos 30 días)
Hi,
I have a correlation output matrix which I obtain through function
*Resultant= Corr(x)*
Let Resultant be a 10x10 matrix.
I wish to extract the location (row and column number) of the top 5 values from the Resultant matrix.
All help will be appreciated.
Regards,
AMD.

Respuesta aceptada

Iman Ansari
Iman Ansari el 4 de Jun. de 2013
Resultant=rand(10,10);
[B,IX] = sort(Resultant(:),'descend')
[r c] = ind2sub(size(Resultant),IX(1:5))

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by