Effacer les filtres
Effacer les filtres

How to find the indices of minimum value in a 4D matrix?

5 vues (au cours des 30 derniers jours)
ANANTA BIJOY BHADRA
ANANTA BIJOY BHADRA le 20 Juin 2023
Réponse apportée : Matt J le 20 Juin 2023
I have a matrix genertared using 4 for loops, The generated matrix is of (3*11*11*11) in size. I need to find the lowest value and indiceswhere the lowest value is present. I tried to use the find command but as far as I understand it wokrs for 2D (x*y) matrices (I might be wrong). How can I find the lowest value and the indices of the lowest value for the (3*11*11*11) matrix?

Réponse acceptée

Matt J
Matt J le 20 Juin 2023
[lowestValue,locmin]=min(A(:))
[i,j,k,l]=ind2sub(size(A), locmin); %indices of min

Plus de réponses (0)

Catégories

En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by