Hello, I am trying to implement a certain formula in Mex file but I have a problem. The idea of the code is to compute a sum of several spherical Bessel function computations of several orders for the same value. The code also contains some complex terms.
What I am trying to do here is to claculate the sum of all elements of mat_1 and put it into R (same as to mat_2: put it into I) and then set R to be the real part of the final matrix img_mat and also set I to be the imaginary part of it. However I keep getting the error messages: error C2664: 'mxSetPr' : cannot convert parameter 2 from 'double' to 'double *' error C2664: 'mxSetPi' : cannot convert parameter 2 from 'double' to 'double *'
Which indicate to lines (1 and 2) at the end of the code. I believe that I am confusing the usage of mxArray with the usage of double array so can somebody please help me with this code? and Also some explanation on the difference between (mxCreateDoubleMatrix) and (mxMalloc) would be great. Thanks so much in advance. Hazem