title: MATLAB - integral2 and mvnpdf
body: <p>I know this question has been asked in a 1D form before (see <a href="https://stackoverflow.com/questions/12688759/quad-with-mvnpdf-involves-vector-in-matlab">quad with mvnpdf involves vector in MATLAB</a>) but I cannot seem to use this for the 2D case. I wish to evaluate</p>
  
  <pre><code>integrand = @(x1,x2) mvnpdf([x1,x2],[0,0],[1,0;0,1]);
  integral2(integrand,-10,10,-10,10)
  </code></pre>
  
  <p>but receive the error</p>
  
  <pre><code>X and MU must have the same number of columns.
  </code></pre>
  
  <p>I know I need to specify the integrand function to perform element-wise operations but my attempts have been futile. Any help would be appreciated...</p>