Return Double Complex Array in MEX file (Matlab)

  c++, matlab, mex

I have a problem with MEX files in C/C++ coding.
I need to return a double complex array to Matlab but I am not able to do that and I don’t find information about it. I show my code with some tries:

double complex output[nSymb];
nlhs = 1;
plhs[0] = mxCreateDoubleMatrix(nSymb,(mwSize)nlhs,mxCOMPLEX);
plhs[0] = output;
memcpy(plhs, output, nSymb * sizeof(double complex));
plhs = output;

Thanks you in advance.

Source: Windows Questions C++