function ans = belong( x, Y)
%
%   The function belong (x, Y) checks whether the string 
%   x is equal to any of the rows of the vector of strings Y.
%   If yes, it returns the value 'yes', if no, it returns 'no '.
%
%   ------------------------------------------------------------
%   Written by Vassilis Zervakis, while at
%              AINCO-Interocean, Madrid, Spain, in January 1996.
%   ------------------------------------------------------------
if Y == [],
    ans = 'no ';
  else
    k = 1;
    while k <= length(Y(:,1)),
      ans = strcmp(x, Y(k,:));
      if ans == 1,
        ans = 'yes';
        k = length(Y(:,1)) + 1;
      else
        ans = 'no ';
        k = k + 1;
      end
    end
end
