How can I pass an Eigen Matrix as a Matlab output parameter?
I tried this from [EIGEN] How to get in and out data from Eigen matrix:
MatrixXd resultEigen; // Eigen matrix with some result (non NULL!)
double *resultC; // NULL pointer
Map<MatrixXd>( resultC, resultEigen.rows(), resultEigen.cols() ) = resultEigen;
But it lack information, how to pass the info in resultC to plhs[0] ? Also, when I run the code using this Map, Matlab closes.