title: Girko's Circular Law using matlab
body: <p>I have solved my problem using a specific function, but I have to calculate <a href="https://en.wikipedia.org/w/index.php?title=Girko%27s_Circular_Law" rel="nofollow noreferrer">Girko's Circular Law</a> using <a href="https://uk.mathworks.com/help/matlab/ref/parfor.html" rel="nofollow noreferrer">parfor</a> or <a href="https://uk.mathworks.com/help/distcomp/spmd.html" rel="nofollow noreferrer">spmd</a> functions. I didn't do this. There is my function. </p>
  
  <p>Let λ_i be (possibly complex) eigenvalues of a set of random  real matrices with entries independent and taken from a standard normal distribution. Then as λ_i is uniformly distributed on the unit disk in the complex plane. For small , the distribution shows a concentration along the real line accompanied by a slight paucity above and below (with interesting embedded structure). However, as , the concentration about the line disappears and the distribution becomes truly uniform. </p>
  
  <p>Test the Circular Law, which states that the eigenvalues of a set of random N x N real matrices with entries independent and taken from the standard normal distribution (Hint: You can use built-in MATLAB function) are asymptotically constrained inside a unit circle of radius  in the complex plane. </p>
  
  <p>Write a program that calculates the eigenvalues (Hint: You can use eig function of MATLAB) of many (i.e., 1000, 2500, 5000 and 10000 depending on your machine) normally distributed random matrices of size n x n (i.e., 100x100). Plot the real and imaginary parts of all these eigenvalues on the plane (i.e., use the real parts as x-values and the imaginary parts as y-values), and draw a circle of radius √ (i.e., ) around it to verify the Circular Law. List the total number of points that are not inside the circle.  </p>
  
  <p>Write the same program using parallel programming paradigms (i.e., parfor and/or spmd). Report the obtained results (similarly to the ones in Slides 460 and 461). Test your code with different size of matrices (50x50, 100x100, 250x250, 500x500 etc. depending on your machine) and report the running time results with different numbers of workers. </p>
  
  <pre><code>function [  ] = Girko(N,n )
  %UNTİTLED4 Summary of this function goes here
  %   Detailed explanation goes here
  %N-&gt; Matrix number
  %n-&gt; dimension of a matrix
  hold on
  for i=0:N
  plot(eig(randn(i)) / sqrt(n),'.');
  end
  ang=0:0.01:2*pi; 
  xp=1*cos(ang);
  yp=1*sin(ang);
  x=0;y=0;
  plot(x+xp,y+yp);
  hold off
  end
  </code></pre>