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: Creating Mex file in Matlab for intrinsic complex number operations
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
neil.a.salmon@gmail.com

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.

Neil



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.