Date: Nov 26, 2012 10:29 PM
Author: Jerome
Subject: Complex Matrices in Armadillo

I am having difficulty with converting my complex array from matlab to armadillo. I am unsure why it is the case? Any assistance would be great!

void complex_matlab2arma(cx_mat& A, const mxArray *mxdata){
arma::access::rw(A.mem)=mxGetPr(mxdata);
arma::access::rw(A.n_rows)=mxGetM(mxdata); // transposed!
arma::access::rw(A.n_cols)=mxGetN(mxdata);
arma::access::rw(A.n_elem)=A.n_rows*A.n_cols;
};

void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
cx_mat::fixed <621,1>data1;
dataptr=mxCreateDoubleMatrix(621,1176,mxCOMPLEX);
dataptr = mexGetVariable("base", data_name);

complex_matlab2arma(data1,dataptr);

}

I am receiving the following error: error: cannot convert 'double*' to 'const arma::cx_double*' in assignment