Skills

Matlab Generate Code

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

Install

npx skills add matlab/matlab-agentic-toolkit --skill matlab-generate-code -g -a claude-code -y
Category
Testing
Updated
8d ago
License
See repository
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

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.

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

Read the whole SKILL.md on GitHub

More in Testing