%Unable to perform assignment because the left and right sides have a different number of elements.
That would give
Matrix dimensions must agree.
I need the value 2 in A to be compared with both value 2 in B.
Is there any methos to achieve comparing array with 2 element with array with 3 element by using "find" fucntion?
>> [R,C] = find(B == A.')
Read that as B(1) = A(1), B(2) = A(2), B(3) = A(2)
But I have to wonder whether you really want to use find. I can't tell what you are really aiming to do with the information. I suggest you consider
>> [wasthere, idx] = ismember(B,A)
Or perhaps ismember(A,B) depending what you are trying to do.