Constraint Function plz help

plz someone help me, im trying to write a constraint function to remove phases smaller than -15 and phases higher than 25. i tried to but nothing worked plz help

ps here is the code so you can know what im talking about

%Godara Method
% Example 8.1
d=.5;
N=10;
sig2=.001
theta=-pi/2:.01:pi/2;
ang=theta*180/pi;
th0=0; % receive angle
th1=-15*pi/180; % first interferer angle
th2=25*pi/180; % second interferer angle

n=0:(N-1);
a0=[exp(-1j*(2-n)*pi*sin(th0)) ]'; % received angle steering vector
a1=[exp(-1j*(2-n)*pi*sin(th1)) ]'; % interferer 1 steering vector
a2=[exp(-1j*(2-n)*pi*sin(th2)) ]'; % interferer 2 steering vector
A=[a0 a1 a2];

%I=eye(length(A(1,:)));
%u1=I(:,1);
%w=u1'*A'*inv(A*A'+sig2*eye(N));

w= ga(@cost,N,[],[],[],[],-0.1*(ones(1,N)+j*ones(1,N)),0.1*(ones(1,N)+j*ones(1,N)));

for j=1:length(theta)
th=theta(j);
% aa=[exp(-1j*pi*d*sin(th)) 1 exp(1j*pi*d*sin(th))]';
aa=[exp(-1j*(2-n)*pi*sin(th)) ]';
y(j)=w*aa;
end
figure;
plot(ang,abs(y)/max(abs(y)),'k')
axis([-90 90 0 1])
xlabel(' heta')
ylabel('|AF( heta)|')