Вот пример кода, который делает то, что я думаю, вы пытаетесь сделать:
%Test data
A = [...
1 2 3 4; ...
4 5 6 7; ...
8 1 3 4];
%Basic "unique" call
[B, ix_A, ix_B] = unique(A);
%Note that the indexes from unique can be used as follows
isequal(A(ix_A), B ) %Returns true
isequal(B(ix_B), A(:) ) %Returns true
%To find a row (and column) in A where each element in B can be found we
%just need to convert the linear indexs into row/column subscripts
[row, column] = ind2sub(size(A), ix_A);
% Note that in general, multiple rows will contain each value from A.
% This will always produce one of the rows (and columns), pracitcially,
% it looks like to returns the last row containing the value.