I am trying to dynamically declare an array of `mxArray` in a `MATLAB` `mex` file. 

```
#include "mex.h"

void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{

    #define PRHS_NLEVELS prhs[0]
    double *NLevel = mxGetPr( PRHS_NLEVELS );
    int nLevel = (int) NLevel [0];

    mxArray *Ain = (mxArray *) mxMalloc( nLevel * sizeof(mxArray) );

}

```

An image will be input to this `mex` function and `Ain` will store its pyramidal images at different levels. The compilation error I get is as follows:

```
mymex.cpp(59) : error C2027: use of undefined type 'mxArray_tag' 
    c:\program files\matlab\r2012b\extern\include\matrix.h(299) : see declaration of 'mxArray_tag'

```