MATLAB: How to find the common values in two arrays common Suppose I have two vectors a= 1 2 3 4 b= 4 5 6 7 9 How do I find which value is common to both in above case it is 4 Best Answer You need the intersect command doc intersectin your case [val,pos]=intersect(a,b) % gives common val and its position in 'a' Related SolutionsMATLAB: Find common elements(?) in two arrays [ii,jj]=find(A==B)% you can addout=[ii jj] MATLAB: Finding coordinates of a number [ii,jj]=find(A==B) Related QuestionFind common factors in two expressions
Best Answer