MATLAB: Comparing two arrays of different length array Hi, I have two arrays like, A=[11 11 2 3; 5 2 6 9] and B=[11 3; 2 9]. I want to know the indices of array A where the column of B is equal to column of A. In this case, the indices are [2 4]. How can I do that? Thanks in Advance. Best Answer You could this to find it:idx = ismember(A', B', 'rows');c = 1:size(A, 2);d = c(idx); % is your answer Related SolutionsMATLAB: Add 8 to the elements of matrix a=[1 7 5 7 2 3 8 2 9 5] that are higher than 3 a( a > 3 ) = a( a > 3 ) + 8 MATLAB: Find indices of one array in another array. [~,idx]=setdiff(A,B,'rows');idx_rows=setdiff(1:size(A,1),idx) Related QuestionDelete rows in Matrix ‘A’ with same values ‘c’ in column ‘b’Comparing two matrix for similar matrixFind row and column in 10 by 2 matrix that contain a particular row elementHow can I FIND column of array part from another large arrayGroup array in a cell according to their size
Best Answer