storing indices of some entries in a matrix

1 Ansicht (letzte 30 Tage)
R yan
R yan am 20 Apr. 2014
Bearbeitet: Mischa Kim am 20 Apr. 2014
I want to store the index of all the entries with value 5 in a matrix. is there an inbuilt function for it.

Antworten (1)

Mischa Kim
Mischa Kim am 20 Apr. 2014
Bearbeitet: Mischa Kim am 20 Apr. 2014
Ryan, use
[r c] = find(data==5)
r and c are the row and column indices of all data entries equal to 5.

Kategorien

Mehr zu Data Types 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