How to find index using max function to multi array???

조회 수: 1 (최근 30일)
Alan
Alan 2014년 2월 14일
댓글: Alan 2014년 2월 14일
Hi all, I want to find index of maximum value in my set of experiments. However, my data are composed by 4 dimensions such as A(i,j,k,l). How can I do to find the 4 indices for maximum value in A.
for exemple: B=max(A(:));
So, B=maximum value;
Now I want to find index of this value on my four dimensions.
thanks

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 2월 14일
편집: Azzi Abdelmalek 2014년 2월 14일
A=rand(3,4,2,5);
[ii,jj]=max(A(:));
[a,b,c,d]=ind2sub(size(A),jj)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by