add dynamic array allocation using mxMalloc, and pass the memory allocated to eigen matrixXd using Map<matrixXd>