What problem does it solve?
Legacy MEX files written with the Separate Complex API (mxGetPr/mxGetPi) fail to compile with mex -R2018a or silently return wrong results on complex arrays, and they incur O(n) deinterleave/re-interleave copy overhead on every call. This Skill guides a verified, step-by-step migration to the Interleaved Complex API.
Core Features & Use Cases
- Guided 7-step migration workflow: Pre-upgrade analysis, output file decision, IC-only vs SC/IC guarded mode selection, iterative refactoring, build, verification, and documentation.
- Complete API mapping tables: Required and recommended replacements for mxGetPr, mxGetPi, mxGetData, mxGetImagData, and type-specific accessors for all numeric types in C, C++, and Fortran.
- SC/IC guarded builds: Patterns using #if MX_HAS_INTERLEAVED_COMPLEX so one source compiles under both mex -R2017b and mex -R2018a, including Fortran .F preprocessor requirements.
- Performance quantification: Benchmark template and guidance showing how IC conversion eliminates boundary copy overhead for large complex arrays.
- Use Case: A user has a legacy Fortran MEX file from File Exchange using mxGetPr/mxGetPi via %val() pointers. The Skill converts it to an SC/IC guarded .F file, provides build commands for all three modes, and supplies assertion-based tests comparing old and new outputs.
Quick Start
Convert my legacy MEX file filter.c from the separate complex API to the interleaved complex API and verify the outputs match.