Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Complex Matrices in Armadillo
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Jerome

Posts: 48
Registered: 12/9/11
Complex Matrices in Armadillo
Posted: Nov 26, 2012 10:29 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.