I am trying to manually write a set intersection function in matlab. I need to compare all of the elements of each vector. Right now for the comparison I have an for loop with an if statement inside:
for i = 1:length(uset1)
if uset1(i) == uset2(i)
result = i;
uset1 and uset2 are single row vectors where no elements are duplicated. Whenever I try to run I get an error saying that '==' is an undefined operator for input arguments of type 'cell'. Is there another way to compare individual elements of two vectors?