matlab-upgrade-mex-ic
Installation
SKILL.md
Upgrade MEX Files to Interleaved Complex API
Convert C, C++, and Fortran MEX source files from the Separate Complex (SC) API to the Interleaved Complex (IC) API, following the MathWorks upgrade workflow with guardrails for SC/IC guarded builds using MX_HAS_INTERLEAVED_COMPLEX, required vs recommended changes, and verification.
When to Use
- User has a C, C++, or Fortran MEX file using
mxGetPr/mxGetPi,mxGetData/mxGetImagData, ormxSetPr/mxSetPi - User wants to build with
mex -R2018a - User asks about interleaved complex, IC MEX, or modernizing MEX code
- User has legacy MEX code from File Exchange, GitHub, or pre-R2018a era
- User has a C++ MEX file (
.cpp,.cxx) using the C Matrix API (mxGetPr/mxGetPi, etc.) - User has a Fortran MEX file (
.F,.f90) usingmxGetPr/mxGetPivia%val()pointers - User reports a MEX function is slow on large complex arrays (call overhead, not loop)
- User asks how to improve MEX performance for complex data