title: How to convert a matrix in matlab to a double[,] array in C#/.NET?
body: <p>How can I convert matrix of type MWArray (returned from matlab runtime) to a 2-dim array (double[,]) in C#?</p>
  
  <p>I am working on the simplest matlab &amp; .NET integration as explained in:
  <a href="http://domoreinlesstime.wordpress.com/2013/01/26/access-matlab-from-c/" rel="noreferrer">http://domoreinlesstime.wordpress.com/2013/01/26/access-matlab-from-c/</a></p>
  
  <p>With the following statement I can convert the variable <em>result</em> of type MWArray to a 1-dim array:</p>
  
  <pre><code>double[] arr = (double[])((MWNumericArray)result).ToVector(MWArrayComponent.Real);
  </code></pre>
  
  <p>Is there a simple way to convert <em>result</em> into a 2-dim array in C#?</p>