Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Creating Mex file in Matlab for intrinsic complex number operations
Posted:
Dec 6, 2012 6:31 AM
|
|
I'm wanting to create a Mex file from a *.c or *.cpp program which operates using intrinsic complex arithmetic. I've seen how in a *.c program mex routines can be used to separate real and imaginary array constituents of a complex number array. I've developed my *.c and *.cpp programs to use the intrinsic complex arithmetic capabilities of gcc, gpp and Visual Studio compliers. I now want to bring the programs into the Mex file in Matlab. However, including libraries like the #include "mex.h" and #include <complex> libraries does not even allow declarations of arrays to be complex such as "double complex" for C and "complex<double>" in Cpp.
I'm not wanting to break the problem down into real and imaginary components, i just want to use intrinsic stand complex arithmetic which works fine in Matlab, C and Cpp. Is there a way to transfer complex arrays from Matlab code, through a Mex file (built from within Matlab) and into C/Cpp programs, examples might be helpful. Matlab help files seem inadequate for this.
Grateful for any suggestions.
Neil
|
|
|
|