Imaginary parts of FFT in C++ project are absent

Hello! I need to invoke matlab FFT from c++ project. I'm new to matlab-c++ interaction, and I've faced with the problem that auto generated c++ library function returns only real parts of FFT vector. Here is my matlab function:
function X = fft_test(x)
%#function fft
X = fft(x);
end
And this is how I invoke it from c++ project:
mwArray xData(size, 1, mxDOUBLE_CLASS, mxREAL);
xData.SetData(x, size);
mwArray resultData;
fft_test(1, resultData, xData);
resultData.GetData(result, size);
(here x is a pointer to the first array element)
After such action I have only real parts in the "result" vector. What I do wrong?

Answers (0)

Products

Tags

Asked:

on 19 Jan 2015

Edited:

on 20 Jan 2015

Community Treasure Hunt

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

Start Hunting!