function p = find_equiv_posns_noC(vsmall, vlarge)
% FIND_EQUIV_POSNS p[i] = the place where vsmall[i] occurs in vlarge
% p = find_equiv_posns(vsmall, vlarge)
% 
% e.g., vsmall=[2,8], vlarge=[2,7,8,4], p=[1,3]

if ~subset(vsmall, vlarge) % the subset function is slow
  error('small domain must occur in large domain');
end

n = length(vsmall);
p = zeros(1,n);
for i = 1:n
  j = find(vlarge == vsmall(i));
  p(i) = j;
end

%[p,J] = find(repmat(vsmall(:)', [length(vlarge) 1]) == repmat(vlarge(:), [1 length(vsmall)]));
% slower
