The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Creating Mex file in Matlab for intrinsic complex number operations
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List

Posts: 1
Registered: 12/6/12
Creating Mex file in Matlab for intrinsic complex number operations
Posted: Dec 6, 2012 6:31 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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.


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.