MATLAB: FInd vector in matrix findmatrixvector Lets assume that I have a matrix A 300×2 with x y coordinates. I want to find how many times a specific [x y] exists in this matrix A. I ve tried this but find can search only single values. i = find(A == [x y]); Any idea????? Best Answer Another method:I = sum(A(:, 1) == x & A(:, 2) == y);EDITED: Buggy multiplication method removed. Thanks Andrei!This method is about 50 times faster than ISMEMBER(A, b, 'rows'). Related SolutionsMATLAB: Find the first column of a 3×3 matrix A = rand(3,3);x = A(:,1); MATLAB: Sort a Matrix based on a column [lastvals, idx] = sort(A(:,end));sortedA = A(idx,:); Related QuestionHow to find peaks along a dimension in a 3d matrixHow to assign NaN in matrix by maskingSummin elements on the rows of a specific page of a matrixVector to repeated matrix multiplicationCommand to calculate the coordinates of points
Best Answer