N = size(a,1);
xx = zeros(N,1);
for i = 1:N
f=@(y)(y-y.*x(i).^2+x(i).*(y.^2.*x(i).^2-y.^2+b(i).^2.*m(i).^2).^0.5)./(b(i).*(y-y.*x(i).^2+x(i).*(y.^2.*x(i).^2-y.^2+n(i).^2).^0.5))-a(i);
xx(i) = fzero(f,0);
end
options = optimset('fzero');
options.Display = 'off';
rng('default');
for i = 1:N
f=@(y)(y-y.*x(i).^2+x(i).*(y.^2.*x(i).^2-y.^2+b(i).^2.*m(i).^2).^0.5)./(b(i).*(y-y.*x(i).^2+x(i).*(y.^2.*x(i).^2-y.^2+n(i).^2).^0.5))-a(i);
[xx(i),fx(i),exitflag,output] = fzero(f,0,options);
aa = 0;
while exitflag~=1
aa = aa + 1;
x0 = 100*randn(1);
if ~isinf(f(x0)) && isreal(f(x0))
[xx(i),fx(i),exitflag,output] = fzero(f,x0,options);
end
if aa>1000
break
end
end
end
find(isnan(fx)|abs(fx)>1)