title: dealing with emxArray_real_T data in C++
body: <p>I have converted a piece of code to C++ using Matlab and now have them in MSVC++. </p>
  
  <p>My function: myFunction gets two inputs and has one output. Following, I tried to make the inputs, a, b, and allocate the output, but I got this error: <strong>error C3861: 'emxCreate_real_T': identifier not found</strong></p>
  
  <p>The function prototype looks like this, which in essence is C = A + B:</p>
  
  <pre><code>#include "myTestFunction.h"
  #include "myTestFunction_emxutil.h"
  
  void myTestFunction(const emxArray_real_T *A, const emxArray_real_T *B,
                      emxArray_real_T *C)
  {
    int i0;
    int loop_ub;
  
    i0 = C-&gt;size[0] * C-&gt;size[1];
    C-&gt;size[0] = A-&gt;size[0];
    C-&gt;size[1] = A-&gt;size[1];
    emxEnsureCapacity((emxArray__common *)C, i0, (int)sizeof(double));
    loop_ub = A-&gt;size[0] * A-&gt;size[1];
    for (i0 = 0; i0 &lt; loop_ub; i0++) {
      C-&gt;data[i0] = A-&gt;data[i0] + B-&gt;data[i0];
    }
  }
  </code></pre>
  
  <p>and here is my main function:</p>
  
  <pre><code>int main() {
      double a[3][3];
      double b[2][2];
      double result[4][4] = {};
  
  emxArray_real_T *inpA, *inpB, *outp;
  
  // define input matrix
  double p = 0;
  for (int i = 0; i &lt; 3; i++) {
      for (int j = 0; j &lt; 3; j++){
          a[i][j] = p;
          p = p + 1;
      }
  }
  
  double k = 0;
  for (int i = 0; i &lt; 2; i++) {
      for (int j = 0; j &lt; 2; j++) {
          b[i][j] = k;
          k = k + 1;
      }
  }
  
  inpA = emxCreateWrapper_real_T(*a, 3, 3);
  inpB = emxCreateWrapper_real_T(*b, 2, 2);
  outp = emxCreateWrapper_real_T(*result, 4, 4);
  
  //inpA = emxCreate_real_T(a, 3, 3);
  //inpB = emxCreate_real_T(b, 2, 2);
  //outp = emxCreate_real_T(result, 4, 4);
  
  myTestFunction(inpA, inpB, outp);
  
  //print result
  for (int i = 0; i &lt; 4; i++) {
      for (int j = 0; j &lt; 4; j++)
          cout &lt;&lt; outp[i].data[j] &lt;&lt; endl;
  }
  
  return 0;
  </code></pre>
  
  <p>}</p>
  
  <p>How should I declare the inputs and output?</p>