Imaginary parts of FFT in C++ project are absent
Show older comments
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)
Categories
Find more on Deploy to C++ Applications Using mwArray API (C++03) in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!