title: 2d gaussian with matlab?
body: <p>I want to draw a gaussian in two dimension centered in the middle of the matrix with matlab. Right now I am doing with</p>
  <pre><code>for i = 1:size2
      for j = 1:size2
          gauss(i,j)=A*exp(-1/(sigma^2)*((i-round(size2/2))^2+(j-round(size2/2))^2)); %gaussiana
      end
  end
  </code></pre>
  <p>but it can be extremely slow.</p>
  <p>In matlab I have not found any function, what is the fastest way to do it? Is a mex file a valuable option?</p>