Shehab - are you sure that the y is a 1x2 array like [2,3]? Or is it a 2x1 array like [2,3]'? If the latter, then you are trying to horizontally concatenate a 1x1 scalar with a 2x1 array and so the error makes sesne. From find, this function returns a vector with the same orientation as the input array. And your input at
y = find(a(iu) == matrix(:, i))
suggests that it is a column array/vector since you are comparing against the ith column of matrix. Use the MATLAB debugger to step through the code to validate this.