필터 지우기
필터 지우기

Find a element and return indices of a array 3D

조회 수: 30 (최근 30일)
Geppo Batt
Geppo Batt 2012년 5월 10일
댓글: Rizal ICHWANSYAH 2022년 7월 21일
I have this matrix http://dl.dropbox.com/u/59868217/tmis.mat and I would find something like this name = 5.255560000000000e +02, obtaining output indices of that element. I used this command:
[pnt, size, cmd] = find (tmis == name);
But in this case I get the indexes that do not correspond in fact should be pnt = 4, size = 16, cmd = 2. I read in the matlab documentation which states: "[row, col, v] = find (X, ...) returns a column or row vector v of the nonzero entries in X, as well as row and column indices. If X is a logical expression, then v is a logical array. Output v contains the non-zero elements of the logical array Obtained by Evaluating the expression X " How can I do to get all three indexes?

채택된 답변

Andrei Bobrov
Andrei Bobrov 2012년 5월 10일
clear size % ;)
c = find (tmis == name);
[a b d] = ind2sub(size(tmis),c);
  댓글 수: 3
Geppo Batt
Geppo Batt 2012년 5월 11일
thank you very much both
Rizal ICHWANSYAH
Rizal ICHWANSYAH 2022년 7월 21일
Thank you so much!!!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Honglei Chen
Honglei Chen 2012년 5월 10일
idx = find(tmis == name);
[row,col,pag] = ind2sub(size(tmis),idx)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by