function I=findall(x,n);
%FINDALL--finds all sequences of the same value repeated n or more times
%
% I=findall(x,n);
%
% For a vector x, finds the starting location of any sequences of the same
% number repeated n or more times.
%
%Ex: x=[ 1 2 3 3 3 3], n=3
%    then I=[3]
%

I=findallseq(x,n);%get answers from findallseq
if(length(I)>=2)
    d=diff(I);
    J=find(d==1);%
    if(~isempty(J))
        I(J+1)=[];%delete duplicates
    end
end
    