Standard arithmetic operators and interleaved complex numbers in mex

Hello,
sorry if this is a duplicate. I tried to ask this question before, but I am not able to find it anymore.
I would like to know (before I update to r2018a) if it is possible to use arithmetic operators (like +,-,*,/) in a similiar way than in c99.
E.g. for complex x,y and z:
z = x + y;
z = x * y;
z = x / y;
z = x - y;
Thanks a lot for you help
Christopher

Answers (1)

It looks like you need to work with the real & imag data elements individually from this page of the doc:
https://www.mathworks.com/help/matlab/matlab_external/handling-complex-data-c.html

Categories

Products

Asked:

on 16 Mar 2018

Answered:

on 22 Mar 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!