I have the next matrix:
A =
0 0 0
0 0 1
0 0 2
0 1 0
0 1 1
0 1 2
0 2 0
0 2 1
0 2 2
1 0 0
1 0 1
1 0 2
1 1 0
1 1 1
1 1 2
1 2 0
1 2 1
1 2 2
Is it possible to know the matrix index of a (x,y,z) value? For example (x,y,z) = (0,2,0) would be index=7:
A(7,:)= (0,2,0)

답변 (1개)

the cyclist
the cyclist 2019년 8월 5일
편집: the cyclist 2019년 8월 5일

1 개 추천

[tf,idx] = ismember([0 2 0],A,'rows')
The output idx gives the row index. See ismember for details.

카테고리

도움말 센터File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

질문:

2019년 8월 5일

편집:

2019년 8월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by