function [BEST,FITBEST] = Spotted_Hyena_Optimization1(fobj ,N,Lower,Upper,Maxiter)
D=length(Lower);
P=zeros(N,D);
PNEW=zeros(N,D);
NEWP=zeros(N,D);
Dh=zeros(N,D);
fitness=zeros(1,N);
BEST=zeros(1,D);
for i=1:N
  for j=1:D
    P(i,j)=Lower(j)+(Upper(j)-Lower(j))*rand;
  endfor
  fitness(i)=fobj(P(i,:));
endfor
[minval, mindex]=min(fitness);
BEST=P(mindex,:);
iter=1;
while(iter <= Maxiter)  
   h=5-(iter*(5/Maxiter));
   for i=1:N
     Dh(i,:)=abs((2.0.*rand.*BEST) - P(i,:));
     PNEW(i,:)=BEST-(2.0.*h.*rand-h).*Dh(i,:);
   end
   PNEW = boundary (PNEW, Lower,Upper,N,D);
   P = update (P,PNEW,fobj);  
   for i=1:N
     NEWP(i,:)=newsol(P);
   end  
   NEWP = boundary (NEWP, Lower,Upper,N,D);
   P = update (P,NEWP,fobj);
   P = sortX (P,fobj,N,D);
   BEST=P(1,:);
   FITBEST=fobj(BEST);
   iter=iter+1;
end 
endfunction