I want to calculate count of outside points which are not in the circle. But I got this problem. My circle is unit circle.My Error is this : The temporary variable outside will be cleared at the beginning of each iteration of the parfor loop.
function [ ] = girkoson( N,n )
%UNTİTLED Summary of this function goes here
% Detailed explanation goes here
hold on
outside = 0;
parfor i=0:N
E=ones(N,n);
karekok = sqrt(n);
E = [E, eig(randn(n))/karekok];
a=real(E);
b= imag(E);
plot(a,b,'.r');
if (a>= -1) | (a<=1) | (b>=-1) | (b<=1)
outside = outside +1;
fprintf('%f',outside);
end
end
derece=0:0.01:2*pi;
xp=1*cos(derece);
yp=1*sin(derece);
x=0;y=0;
plot(x+xp,y+yp,'-b');
hold off
end