Effacer les filtres
Effacer les filtres

Find index in 3D matrix for maximum value

3 vues (au cours des 30 derniers jours)
Sharif Khalil
Sharif Khalil le 17 Juil 2018
Commenté : Sharif Khalil le 17 Juil 2018
I have a 3D matrix 40X181X361, I want to find the index for the maximum value for each of the 40. Pp_loc gives me the 40 maximum values, I would like to find their indicies.
if true
% code
end
Xp = 10:50:2*Km;
Yp = 1*Km;
rho_p = sqrt(Xp.^2+Yp^2+HT^2);
FSPL_p = (4*pi*rho_p/lmda).^2; % Free Space Path Loss for Probe
Pp_dBm = zeros(length(Xp),length(thta),length(phi));
Pp_loc = zeros(1,length(Xp));
for pp = 1:length(Xp)
Pp_dBm(pp,:,:) = 30 + 10*log10((4*pi*abs(AF_Field_P).^2)/FSPL_p(pp));
Pp_loc(pp) = max(max(Pp_dBm(pp,:,:))); % Maximum Power at Probe
end

Réponses (1)

OCDER
OCDER le 17 Juil 2018
Here's one example to find maximum value in a 3D matrix called A
A = randi(100, 3, 3, 50)
[x, y, z] = ind2sub(size(A), find(A == max(A(:))))
  1 commentaire
Sharif Khalil
Sharif Khalil le 17 Juil 2018
What I am looking for is for every value of x, the maximum value of the matrix y and z. which will give an answer looks like x =1; y = 80; z = 50; x = 2; y = 30; z = 100; and so on. Thanks

Connectez-vous pour commenter.

Catégories

En savoir plus sur Image Processing Toolbox 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