Borrar filtros
Borrar filtros

How to find index in multi-dimension matrix

3 visualizaciones (últimos 30 días)
JZ
JZ el 26 de Nov. de 2021
Respondida: Bjorn Gustavsson el 26 de Nov. de 2021
Say I have a matrix of m x n x l x w (4-D). How may I find the max/min and the corresponding index in 4-D?
I appreciate your help.

Respuesta aceptada

Bjorn Gustavsson
Bjorn Gustavsson el 26 de Nov. de 2021
You can do this in 2 simple steps:
[xMax,idx1D] = max(X(:));
[i1,i2,i3,i4] = ind2sub(size(X),idx1D);
HTH

Más respuestas (0)

Categorías

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

Etiquetas

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by