MATLAB: Comparing two vectors with different dimensions vector comparison Hello, How can you compare two vectors with different number of elements? I am just trying to find the equal elements. Thanks! Best Answer Your question is fairly vague, but I have a feeling that either the ismember() command or the intersect() command will help you do what you want. Related SolutionsMATLAB: How to find the common elements of 2 cell arrays of strings Use the "intersect" function as follows:>> [C,ia,ib] = intersect(A,B, 'stable'); MATLAB: Produce equality matrix based on elements in vector. Trivially done.%assuming A and B are both row vectors:C = A.' == B; If they're both column vectors, transpose B instead. Related QuestionHow to check each element of a vector with each elements of another vector if dimension of both matrix are not equalHow to find the elements of a cell array that are not common to another cell arrayUsing a vector as an index to a matrixFind overlap between 2 arraysIterating through each element in a matrix
Best Answer