Filter löschen
Filter löschen

Find a element and return indices of a array 3D

30 Ansichten (letzte 30 Tage)
Geppo Batt
Geppo Batt am 10 Mai 2012
Kommentiert: Rizal ICHWANSYAH am 21 Jul. 2022
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?

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 10 Mai 2012
clear size % ;)
c = find (tmis == name);
[a b d] = ind2sub(size(tmis),c);

Weitere Antworten (1)

Honglei Chen
Honglei Chen am 10 Mai 2012
idx = find(tmis == name);
[row,col,pag] = ind2sub(size(tmis),idx)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by