"mayur" wrote in message <firstname.lastname@example.org>... > > I did the following which i am not sure if its correct .. please help.. > > A = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); // created a numeric matrix of size 1 and of type double > memcpy(&A,&Amp,sizeof(double)); // copied over the memory from the input argument over to the mxArray..
The above line is an error. What you have done is copy the value of Amp into the first 8 bytes of the mxArray structure of A. What you *want* to do is copy the value into the *data* area of A instead. E.g.,