searching for vector values in a matrix
Ältere Kommentare anzeigen
Hi, I have a vector with 3 specific values and I want to find their indices in a matrix.
1 Kommentar
James Tursa
am 28 Apr. 2015
What are the dimensions of the matrix? Do the values have to be next to each other in the same row or column?
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 28 Apr. 2015
If yourVector is an integer valued vector or a floating point vector with values that are multiples or divisors of 2, then try
firstIndex = find(yourVector == firstSpecificValue);
secondIndex = find(yourVector == secondSpecificValue);
thirdIndex = find(yourVector == thirdSpecificValue);
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!