# Matlab Generate Code

Generate, verify, refine, and accelerate C/C++ or CUDA code from MATLAB with MATLAB...

- Repository: https://github.com/matlab/matlab-agentic-toolkit (1237 stars)
- Category: Testing
- License: see repository
- Last updated: 2026-10-27
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add matlab/matlab-agentic-toolkit --skill matlab-generate-code -g -a claude-code -y`
Codex: `npx skills add matlab/matlab-agentic-toolkit --skill matlab-generate-code -g -a codex -y`
Cursor: `npx skills add matlab/matlab-agentic-toolkit --skill matlab-generate-code -g -a cursor -y`
Gemini CLI: `npx skills add matlab/matlab-agentic-toolkit --skill matlab-generate-code -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add matlab/matlab-agentic-toolkit`

## Description

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.unroll, coder.noImplicitExpansionInFunction, coder.ceval, coder.inline, coder.extrinsic, coder.const, coder.classSignature, class codegen limitations, temporal types codegen, DMA-off, stack-only, host-target InstructionSetExtensions, SIMDAcceleration, OptimizeReductions, host SIMD tuning, host OpenMP, codegen performance.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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

The rest: https://github.com/matlab/matlab-agentic-toolkit/blob/HEAD/skills-catalog/code-generation/matlab-generate-code/SKILL.md
