Install any skill in seconds. Free to start, no credit card required.
Get Started Free →matlab/matlab-upgrade-mex-ic
Upgrade C, C++, and Fortran MEX source files from the Separate Complex (SC) API to the Interleaved Complex (IC) API.
Passed 21 of 22 test cases with the skill, and 15 of 22 without it.
and 3 more in the full report
6 fixed15 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 6 test cases the skill fixed. Same model, same prompt, with and without the skill.
I have a legacy C MEX source file (`spectral_smooth.c`) that uses traditional complex array pointers like `mxGetPr` and `mxGetPi`. I want to modernize this file to support modern MATLAB interleaved complex memory layout. Please audit the source code to report the count of outdated API calls and their performance implications on complex data, ask me about output file targets and backward-compatibility build options before generating code, provide the refactored C source code, give compilation commands, and supply a MATLAB test script to verify numerical equality against the original build.
| Checked | Without skill | With skill |
|---|---|---|
| Prompts the user to choose between creating a new output file or modifying the file in place. | Passed | Passed |
| Prompts the user to choose between an IC-only conversion and an SC/IC guarded conversion. | Passed | Passed |
| Pauses before providing converted source code until the user answers the choices. | Missed | Passed |
The instructions your model reads when the skill loads.
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.
mxGetPr/mxGetPi, mxGetData/mxGetImagData, or mxSetPr/mxSetPimex -R2018a.cpp, .cxx) using the C Matrix API (mxGetPr/mxGetPi, etc.).F, .f90) using mxGetPr/mxGetPi via %val() pointersmxGetDoubles, mxGetComplexDoubles, etc.) from the start for better performance on complex data and modern, type-safe data access instead of legacy mxGetPr/mxGetPimatlab::mex::Function) — different API entirely; this skill covers C++ files that use the C Matrix API (mex.h), not the MATLAB Data API for C++ and C++ EnginemxGetDoubles, mxGetComplexDoubles, etc.) — already IC-compatible, no conversion neededFollow these 7 steps in order. Do NOT skip steps.
Before changing anything, understand the current state:
mxGetPi, mxIsComplex, mxCOMPLEX)Report to the user:
test cases passed, vs 15 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.