1 function ind = face_in_matrix(face, matrix)
2 %
function ind = face_in_matrix(face, matrix)
4 %
function searching
for the 4x1 vector face in the columns of the
5 % 4xn matrix by all cyclical permutations and reflection
6 %
if found, the column-indices are returned in ind, otherwise it is empty
8 % Bernard Haasdonk 13.3.2006
10 matmat = repmat (matrix, 1,8); % =>
11 ff = repmat(face(:),1,size(matrix,2));
12 faceface = [ff, ff([2 3 4 1],:), ff([3 4 1 2],:), ...
13 ff([4 1 2 3],:), ff([4 3 2 1],:), ff([3 2 1 4],:), ...
14 ff([2 1 4 3],:), ff([1 4 3 2],:)];
15 s = sum(abs(matmat-faceface));
19 ind = mod(i-1,size(matrix,2))+1;
23 % TO BE ADJUSTED TO NEW SYNTAX