Search a given row array in a matrix and get position
Show older comments
I am trying to find the ch = ones(1,9)*178 row array in a large matrix. In that matrix, the number 178 on its own appears in many positions but I want to find the positions when the 9-element array with 178 occurs. If the matrix were A=[0 0 0 0 0 0 0 0 0 178 0 0 0 0 0; 1 2 5 3 2 4 178 5 6 2 2 2 2 2 2; 0 2 178 178 178 178 178 178 178 178 178 0 2 3 2]; the result should be row = 3, column =3. I guess ismember must be in the code but I can´t figure out how... Thanks!
Accepted Answer
More Answers (0)
Categories
Find more on Matrices and Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!