필터 지우기
필터 지우기

How to find index in multi-dimension matrix

조회 수: 3 (최근 30일)
JZ
JZ 2021년 11월 26일
답변: Bjorn Gustavsson 2021년 11월 26일
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.

채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2021년 11월 26일
You can do this in 2 simple steps:
[xMax,idx1D] = max(X(:));
[i1,i2,i3,i4] = ind2sub(size(X),idx1D);
HTH

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by