Does MATLAB store complex data in interleaved format since R2018a?
If you compile a MEX function with the -R2018a flag, you can process complex arrays in interleaved format. But what happens, if a MEX function is compiled with the -R2017b flag and called from a modern Matlab version? Does accessing mxGetPr / mxGetPi cause a deep data copy to create the two arrays in separate memory blocks, and another copy to re-create an interleaved array for the output?
This would mean, that MEX fumnctions processing complex data are very inefficient, when they use the -R2017b flag. Is this correct?
Best Answer