matlab-generate-code
Generate, verify, refine, and accelerate C/C++ or CUDA code from MATLAB with MATLAB Coder, Embedded Coder, GPU Coder, or MATLAB Test. Also covers writing codegen-ready MATLAB code: language constraints, coder.* directives, and optimization patterns. Triggers on: codegen, MEX, deploy MATLAB as C/C++, GPU Coder, coder.screener, coder.config, coder.gpuConfig, coder.typeof, coder.runTest, matlabtest.coder.TestCase, SIL, embedded config, no dynamic memory, EnableMexProfiling, coder.timeit, coder.perfCompare, %#codegen, writing codegen-ready MATLAB, code generation readiness, coder.varsize, coder.un
npx skills add matlab/matlab-agentic-toolkit --skill matlab-generate-code --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Generate Code with MATLAB Coder Umbrella skill for the MATLAB Coder workflow: generate code, verify it, refine the config, and accelerate with profiled MEX. ## When to Use - Generating C/C++ or CUDA code from MATLAB functions (MEX, lib, dll, exe) - Writing new MATLAB code that must be compatible with code generation - Reviewing existing MATLAB code for codegen readiness or fixing codegen errors - Configuring codegen settings for specific targets (embedded, speed, readability, safety) - Verifying generated code matches MATLAB output (coder.runTest, matlabtest.coder.TestCase) - Profiling and accelerating generated MEX functions - Using coder.* directives (coder.varsize, coder.const, coder.extrinsic, coder.ceval, etc.) ## When NOT to Use - Simulink Coder / Embedded Coder Simulink-model workflows - Generating code for target languages that are not C, C++, or CUDA - Fixed-Point Designer conversion workflows - Hand-written MEX C files (not generated by MATLAB Coder) - General MATLAB programming unrelated to code generation ### Route to a more specific skill - **Generating code from an AI model** (PyTorch `.pt2` / LiteRT `.tflite` via `loadPyTorchExportedProgram` / `loadLiteRTModel`) →
- When to Use
- When NOT to Use
- Route to a more specific skill
- Routing — load the matching reference file on demand
- Out of scope
- Cross-cutting rules
- Class entry point — use coder.ClassSignature, not a wrapper function
- Ask for input types before writing codegen-ready functions
- One variable, one type, one size category
- Always capture coder.screener output — every time
- Verify with MEX before generating lib / dll / exe
- Never modify the user's source without authorization
- Booleans are logical, not char
- Don't add report flags unless the user asks
What does the matlab-generate-code skill do?
Generate, verify, refine, and accelerate C/C++ or CUDA code from MATLAB with MATLAB Coder, Embedded Coder, GPU Coder, or MATLAB Test. Also covers writing codegen-ready MATLAB code: language constraints, coder.* directives, and optimization patterns. Triggers on: codegen, MEX, deploy MATLAB as C/C++, GPU Coder, coder.screener, coder.config, coder.gpuConfig, coder.typeof, coder.runTest, matlabtest.coder.TestCase, SIL, embedded config, no dynamic memory, EnableMexProfiling, coder.timeit, coder.perfCompare, %#codegen, writing codegen-ready MATLAB, code generation readiness, coder.varsize, coder.un
How do I install it?
Run `npx skills add matlab/matlab-agentic-toolkit --skill matlab-generate-code --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From matlab/matlab-agentic-toolkit, a repository with 868 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
