1 function ind = find_vector(vec, mat, epsilon)
2 %
function ind = find_vector(vec, mat[, epsilon])
4 % find a vector in a matrix. If vec is a row vector, rows of mat are
5 % searched,
if vec is a column, columns of mat are searched.
6 % equality is decided by l2-error being less than epsilon. epsilon can be
7 % ommited, is
default 1e-6
9 % Bernard Haasdonk 29.3.2007
11 %
if row vector, transpose the problem
22 vvec = repmat(vec,1,size(mat,2));
23 diff = sqrt(sum((vvec-mat).^2));
24 ind = find(diff<epsilon);
27 % TO BE ADJUSTED TO NEW SYNTAX