Generated banner for Matlab Generate Code
Generated logo for Matlab Generate Code

Matlab Generate Code

MathWorksOfficialCreated by MathWorks

  • Skill
  • Tool integration
  • Software development
  • BSD-2-Clause
  • No issues found

From the author

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.
— the description by MathWorks

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured workflow for converting MATLAB code into C, C++, or CUDA. It covers the entire lifecycle of code generation, including writing codegen-ready MATLAB, configuring build settings, verifying generated code against MATLAB outputs, and profiling MEX functions for optimization. It leverages MATLAB Coder, Embedded Coder, GPU Coder, and MATLAB Test to ensure compatibility and correctness.

What it does

  • Generates C, C++, or CUDA code from MATLAB functions
  • Configures build settings for specific targets like embedded, speed, or safety
  • Verifies generated code matches MATLAB execution using testing tools
  • Profiles generated MEX functions to identify execution hotspots
  • Provides guidance on codegen-ready MATLAB syntax and directives
  • Manages input type specifications and variable-size array constraints

When to use it

  • When you need to deploy MATLAB algorithms as C/C++ or CUDA code
  • When you need to accelerate MATLAB functions by compiling them to MEX
  • When you are writing new MATLAB code intended for code generation
  • When you need to verify that generated code produces the same results as MATLAB
  • When you need to tune codegen configurations for specific deployment goals

Advantages

  • Enables direct translation of MATLAB algorithms to portable C/C++ or CUDA
  • Provides tools for verifying numerical equivalence between MATLAB and generated code
  • Supports profiling of generated MEX to understand performance characteristics
  • Offers granular control over memory, data types, and optimization patterns
  • Integrates with MATLAB Test for automated verification workflows

Usage examples

“How do I generate C++ code from my MATLAB function named myFunction?”
The agent will guide you through creating a configuration object, specifying input types using coder.typeof, and running the codegen command.
“My code generation failed. How can I check why?”
The agent will instruct you to run res = coder.screener('myFunction') and help you interpret the UnsupportedCalls and Messages fields.
“How can I profile my generated MEX file to find slow parts?”
The agent will show you how to enable EnableMexProfiling in your config, run the MEX under the MATLAB profiler, and extract timing data.
“How do I declare a variable-size array in my MATLAB code for codegen?”
The agent will explain how to use coder.varsize and provide guidance on setting appropriate upper bounds for your specific use case.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/matlab/matlab-generate-code/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip matlab-generate-code.zip -d .agents/skills

Documentation by MathWorks

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) → use matlab-deploy-ai-model. Return here for the underlying coder.* directives, config tuning, and screener/verification.

  • Deploying to physical embedded hardware (on-target PIL, ERT hardware configs, board selection — STM32 / Raspberry Pi / ARM Cortex) → use matlab-deploy-embedded-code. This skill covers host-side codegen, SIL, and config tuning up to hardware targeting.

  • Speeding up interpreted MATLAB by rewriting the M-code (vectorization, preallocation, caching) → use matlab-optimize-performance. This skill's acceleration path assumes you want to compile to MEX/C, not restructure the algorithm.

  • General MATLAB test authoring (parameterized tests, fixtures, mocking, App Designer) → use matlab-write-tests; for running suites, collecting coverage, and CI/CD → use matlab-run-tests. This skill covers only codegen-equivalence tests (coder.runTest, matlabtest.coder.TestCase).

  • Modernizing deprecated APIs for currency/maintainability when code generation is not the goal → use matlab-modernize-code. This skill rewrites source only to satisfy codegen constraints, with explicit authorization.

Routing — load the matching reference file on demand

Pick the workflow that matches the user's intent and read the corresponding references/*.md. Each reference file is a deep, self-contained guide; load only what you need rather than carrying all four in context.

User intentLoad
Writing new codegen-compatible MATLAB; reviewing MATLAB for codegen readiness; fixing codegen errors; %#codegen; language constraints; type/size rulesreferences/write-codegen-ready.md
Understanding a specific coder.* directive (coder.varsize, coder.const, coder.inline, coder.unroll, coder.extrinsic, etc.)references/write-coder-directives.md
Using MATLAB classes in codegen; class limitations; coder.classSignature; handle vs value class restrictionsreferences/write-class-limitations.md
Generate C/C++/CUDA code (MEX, lib, dll, exe), specify input types, fix coder.screener issuesreferences/generate-code.md
Verify generated code matches MATLAB; write coder.runTest / matlabtest.coder.TestCase tests; SIL setupreferences/verify-code.md
Tune a working config for a deployment goal (embedded / speed / readability / size / safety); SIMD values (SIMDAcceleration, InstructionSetExtensions), OpenMP, OptimizeReductionsreferences/refine-config.md
Profile generated MEX, measure coder.timeit / coder.perfCompare, find hotspotsreferences/accelerate-mex.md
Look up a config property's name, availability, or non-obvious behaviorreferences/config-properties.md

Disambiguation — "write" vs. "generate" vs. "generate for a class":

  • "Write codegen-ready code" = authoring/reviewing the MATLAB source so it can be compiled (write-codegen-ready.md)

  • "Generate code" = running codegen to produce C/C++ from an already-valid function (generate-code.md)

  • "Generate code for a class" / "generate C++ class" = the user's source is a classdef file → load generate-code.md (Step 0 handles class entry points via coder.ClassSignature). Do NOT default to wrapping the class in a function.

  • If both apply (user wants to write a function AND generate code from it), load write-codegen-ready.md first, then generate-code.md

For requests that span workflows (e.g., "generate MEX, verify it, then speed it up"), load the references in order rather than all at once.

Out of scope

  • Simulink Coder / Embedded Coder workflows (these are skill candidates of their own).

  • Non-C, C++, or CUDA target languages — this skill covers C/C++ and CUDA code generation only

  • Fixed-point conversion (use Fixed-Point Designer).

  • Hand-written MEX files — the acceleration guidance assumes MATLAB Coder-generated MEX.

  • CodeExecutionProfiling / SIL profiling with Embedded Coder — out of scope for the acceleration reference.

Cross-cutting rules

These apply across every workflow. Apply them whether or not you've loaded a per-workflow reference yet.

Class entry point — use coder.ClassSignature, not a wrapper function

When the user's target is a MATLAB class (classdef file) and they want to generate C++ code from it, use coder.ClassSignature for direct class code generation. Do NOT create a wrapper entry-point function. This produces a proper C++ class with methods — which is what users mean when they say "generate C++ class."

Load references/generate-code.md → Step 0 and references/write-class-limitations.md → "Direct class code generation" for the full workflow. The prerequisite enableCodegenForEntryPointClasses must run once per session.

Only fall back to a wrapper function if the user's MATLAB version lacks coder.ClassSignature (pre-R2026a) or the class structure is incompatible (e.g., handle objects in entry-point I/O).

Ask for input types before writing codegen-ready functions

Before writing any new codegen-ready function, ask the user:

  • Data type of each input (double, single, int32, uint8, logical, struct, etc.)

  • Size/shape (scalar, fixed-size vector/matrix, variable-size with bounds?)

  • Real or complex?

Do NOT ask about variable-size upper bounds unless the user has explicitly requested DMA-off (no dynamic memory) code generation. See references/write-codegen-ready.md for full authoring guidance.

One variable, one type, one size category

A variable cannot change class or complexity after first assignment. This is the #1 source of codegen errors in practice. Assign different-sized values on different branches only after declaring coder.varsize. See references/write-codegen-ready.md for the full constraint list.

Always capture coder.screener output — every time
res = coder.screener('myFunction');   % NOT bare: coder.screener('myFunction')
disp(res.UnsupportedCalls)
disp(res.Messages)

Bare coder.screener('func') opens the GUI with no command-line output. Always assign the return value, then inspect UnsupportedCalls and Messages.

This rule applies to every reference to coder.screener you write — including summaries, status updates, and commentary, not just the actual call you execute. Don't write coder.screener('myFunction') as a bare phrase even when describing what you did; mirror the assignment-syntax form (or just refer to "the screener" prose-style). A bare call in a summary suggests the user should reproduce it that way.

Verify with MEX before generating lib / dll / exe

Generate MEX first and compare its output to the interpreted MATLAB. Once MEX matches, generate the standalone target. Comparing two interpreted MATLAB runs proves nothing — and aggressive optimizations on lib/dll can mask bugs that surface only in the deployed code path.

Never modify the user's source without authorization

The user's MATLAB source is theirs. Even when coder.screener flags an unsupported call or construct, do not silently rewrite the source — present a short summary of the proposed change (which lines, what's removed/replaced, why) and wait for the user to confirm before applying. This applies whether the change is a one-line guard around a try/catch, a swap of containers.Map for a struct, removal of an eval, or a tightened arguments block. The same rule applies when a codegen error suggests a source-level fix.

Trivial mechanical changes still need the same confirmation step. The one exception is a copy of the source into a private working directory for codegen experiments; that copy may be edited freely as long as the original file is untouched.

Booleans are logical, not char

Every Enable* and similar config property takes true / false. Never 'On' / 'Off'. Use class(cfg.PropName) if unsure.

Don't add report flags unless the user asks

Do not pass -report, -launchreport, or set GenerateReport = true unless the user explicitly requests a code-generation report.

Use function-call syntax for variable paths
% YES — function-call syntax evaluates the variable
outDir = fullfile(pwd, 'codegen_output');
codegen('myFunction', '-config', cfg, '-args', {t1, t2}, '-d', outDir)

% NO — command syntax can take "outDir" as a literal directory name
codegen -config cfg myFunction -args {t1, t2} -d (outDir)
Introspect the live config object

Property names, defaults, and per-config-type availability drift across MATLAB releases. Before recommending settings, query the user's actual config:

cfg = coder.config('lib');     % or 'mex', or coder.gpuConfig(...)
class(cfg)                     % CodeConfig vs. EmbeddedCodeConfig vs. MexCodeConfig
properties(cfg)                % full property list for this version
disp(cfg)                      % current values
isprop(cfg, 'EnableMemcpy')    % does a candidate property exist?

Treat the live introspection — not memory of past releases — as ground truth. See references/config-properties.md for more.

Quick Reference — Coder Directives

DirectivePurposeKey gotchaAvailable From
%#codegenEnable codegen analysisMust be on/after function signatureR2011a
coder.typeof(val, sz, varDims)Define input type+size for codegen callvarDims is logical array — true = variableR2011a
coder.varsize('x', [bounds])Declare variable-size with upper boundsWithout bounds → requires DMA; declare before first assignmentR2011a
coder.const(expr)Evaluate expr at compile timeExpression can be arithmetic, a function call, or a combinationR2013b
coder.extrinsic('fn')Exclude function from compilationNo-op in lib/dll/exe unless paired with coder.constR2011a
coder.inline('always'|'never')Control function inliningUse 'always' for small hot helpersR2011a
coder.unroll(range)Unroll loop at compile timeRequired for heterogeneous cell / varargin iterationR2011a
coder.noImplicitExpansionInFunctionDisable broadcasting overheadOnly when operands always match in sizeR2021b
coder.target('MATLAB')Branch between MATLAB and codegen pathsInactive branch is eliminated from generated codeR2011a
coder.nullcopy(zeros(m,n))Allocate without zeroingOnly safe if every element is written before readR2011a
coder.ClassSignatureDirect class code generation entry pointRequires enableCodegenForEntryPointClasses once per sessionR2026a

For full directive documentation, load references/write-coder-directives.md.

Common Mistakes

MistakeCorrect Approach
coder.screener('func') without capturing return valueres = coder.screener('func') then inspect res.UnsupportedCalls and res.Messages
Jumping straight to lib / dll without MEX verificationGenerate MEX first, compare outputs to MATLAB, then generate the final target
EnableRecursion (does not exist)EnableRuntimeRecursion
DynamicMemoryAllocation = 'Off'EnableDynamicMemoryAllocation = false (logical, not char)
MemcpyThreshold = 0 to disable memcpyEnableMemcpy = false
Comparing two interpreted MATLAB runs to "verify" generated codeUse coder.runTest (MEX replacement) or matlabtest.coder.TestCase; or SIL with Embedded Coder
coder.timeit(@myFunction, ...) (function handle)coder.timeit('myFunction', numOutputs, {args}) — string name
Profiling the interpreted MATLAB function instead of the MEXProfile myFunction_mex; interpreted MATLAB has different performance characteristics
Test script run under coder.runTest without assert statementsAlways include assertions — coder.runTest produces no output on success otherwise
Building MEX in every test method with identical input typesBuild once in TestClassSetup; rebuild per test only when input type specs differ
Calling the MATLAB function manually in matlabtest.coder.TestCase testsverifyExecutionMatchesMATLAB calls MATLAB internally — just execute then verify
Command-syntax -d (outDir) for output directoryFunction-call syntax: codegen('func', '-config', cfg, '-args', types, '-d', outDir)
Adding -report, -launchreport, or GenerateReport = trueDon't generate code reports unless explicitly requested
IntegrityChecks = false (MEX) without first running with checks onRun with checks enabled across all expected inputs first; only disable after confirming no bounds errors
EnableDynamicMemoryAllocation = false and EnableVariableSizing = false togetherKeep EnableVariableSizing = true so variable-size arrays stack-allocate at the upper bound
Growing array in loop (x = [x; row])Preallocate full array before loop
Using try/catch in codegen pathReturn status codes; use coder.target('MATLAB') for MATLAB-only error handling
Variable changes type between assignmentsOne variable = one type throughout scope
Function returns different types/sizes on different pathsEnsure consistent output type and size on all paths
Missing %#codegen pragmaAlways include after function signature
coder.extrinsic expecting runtime behavior in lib/dllExtrinsic calls produce no code in portable targets; combine with coder.const
Using coder.ClassSignature / -class without enabling the Tech PreviewRun enableCodegenForEntryPointClasses once per MATLAB session before class code generation

Conventions

  • Follow MathWorks Coding Guidelines for any MATLAB code suggested or written: lowerCamelCase functions, arguments blocks, max 6 inputs / 4 outputs, end terminators.

  • For floating-point comparisons between MEX and MATLAB, use tolerances (AbsTol / RelTol) rather than exact equality. Differences < 1e-10 relative are normal due to different math libraries.

  • For variable-size arrays, specify upper bounds via coder.typeof(example, [maxDims], [variableFlags]).

  • Use coder.Constant for entrypoint inputs whose value is known at compile time so codegen can resolve downstream array sizes statically.


Copyright 2026 The MathWorks, Inc.


Files

references/write-core-constraints.md

Core Constraints for Code Generation

Mandatory requirements for all MATLAB code intended for C/C++ code generation.

1. Always Include the Codegen Pragma

Place %#codegen immediately after the function signature. Enables the Code Analyzer to flag codegen issues in the editor.

function y = myFilter(x, coeffs) %#codegen
    % Function body
end

2. P-Code Support with coder.allowpcode

Include coder.allowpcode('plain') when distributing as p-code. When both .p and .m files exist on the path, p-files take precedence during code generation.

function y = myAlgorithm(x) %#codegen
    coder.allowpcode('plain');
    y = x .* 2;
end

Generate p-file with pcode myAlgorithm.m. Distribute only the .p file.

3. Numeric Literals Default to Double

All numeric literals default to double. Cast explicitly for intended types to avoid unnecessary float ops in generated code.

y = x + 0;              % double arithmetic even if x is single or integer
y = x + single(0);      % single arithmetic
count = count + uint32(1);  % integer arithmetic, no float conversion

4. Define Type and Size Before Use

Every variable must have its class and size determined before first use. The code generator infers size from the first fixed-size assignment — it locks in the size.

% GOOD: type and size clear
y = zeros(1, 100);
for i = 1:100
    y(i) = computeValue(i);
end

% BAD: type/size ambiguous — y grows dynamically
for i = 1:100
    y(i) = computeValue(i);
end

If size may vary, declare coder.varsize BEFORE first assignment:

coder.varsize('x', [1 10]);
x = zeros(1, 3);
x = zeros(1, 10);  % OK: within declared bounds

5. Preallocate Arrays

Never grow arrays inside loops. Preallocate immediately before the loop.

% GOOD
result = zeros(n, m);
for i = 1:n
    for j = 1:m
        result(i, j) = compute(i, j);
    end
end

% BAD — dynamic growth
result = [];
for i = 1:n
    result = [result; computeRow(i)];
end

Static allocation (DMA-off): Avoid all dynamic resizing:

  • No x = [x; newRow] or x(end+1) = val (growth)

  • No x(idx) = [] (shrinking)

  • No unbounded coder.varsize('x') — always provide upper bounds

  • All array sizes must be determinable at compile time or bounded

6. Normalize Input Shape Without Reshaping the Original

When a function accepts inputs in multiple shapes (row vector, column vector, matrix), do not reshape the original variable. Instead, create a new local variable with a consistent shape. This avoids dimension mismatch errors while preserving API flexibility.

function y = process(d) %#codegen
    % Normalize to column vector in a new variable — never mutate d
    if isrow(d)
        dNorm = d(:);    % new variable, always column
    else
        dNorm = d;
    end

    % Use dNorm (consistent shape) for all subsequent computation
    y = cumsum(dNorm);
end

Reshaping the original input variable in-place can trigger size-mismatch or dimension-inference errors because the code generator may have already locked its shape from the entry-point type specification.

Type-based branching: ischar, isnumeric, islogical, isstruct are all codegen-supported and can be used to branch on input type within a single function.

function result = convert(input) %#codegen
    if isnumeric(input)
        result = double(input);
    elseif islogical(input)
        result = double(input);
    else
        result = 0;  % default
    end
end

7. Dimension-Wise Size Inference

Codegen infers variable sizes per dimension independently. If a variable is 1000x1 on one path and 1x1000 on another, inferred size is 1000x1000 — may blow the stack.

% BAD: infers x as 1000x1000
if flag
    x = zeros(1000, 1);    % first dim = 1000
else
    x = zeros(1, 1000);    % second dim = 1000
end

% GOOD: consistent shape
x = zeros(n, 1);  % same dimensions across paths

Fix: Keep dimensions consistent across branches, or use coder.varsize with tight bounds.

8. No Type Reassignment

One variable = one type, one size category. Cannot change class or complexity after first assignment.

% BAD
x = 5; x = 'hello';  % codegen error — type changed

% GOOD
count = 5; label = 'hello';

Different-sized values on different paths require coder.varsize:

coder.varsize('x', [1 5]);
if flag, x = [1, 2, 3]; else, x = [1, 2, 3, 4, 5]; end

Transposing variable-size arrays is also a reassignment — d = d.' changes shape from [1x:?] to [:?x1]. Use a new variable instead:

coder.varsize('d', [1 100]);
d = getData();       % 1x:? (row)
dCol = d.';          % GOOD: new variable for transposed shape

9. Consistent Function Output Types

All execution paths must return outputs of identical type and size. C function signatures have fixed return types.

% BAD: scalar on one path, 1x3 on another
function result = process(x)
    if x > 0, result = x * 2; else, result = [x, x, x]; end
end

% GOOD: consistent 1x3 output
function result = process(x)
    result = zeros(1, 3);
    if x > 0, result(:) = x * 2; else, result = [x, x, x]; end
end

10. Use Only Supported Language Features

Supported: if, switch, for, while, N-D arrays, structs, enums, cell arrays, variable-size (bounded), complex, local/nested/anonymous/recursive functions, varargin/varargout, argument validation, MATLAB classes (with limitations), dictionaries, string scalars, tables, sparse, datetime (full), duration (full), timetable (read-only). See write-temporal-types.md.

NOT Supported:

  • Scripts, try/catch, import, eval/evalin/assignin, Java, Map containers

  • Tall arrays, GPU arrays (unless GPU Coder), calendarDuration, pattern arrays

  • Arrays of class objects — use struct arrays or scalar objects with array-valued properties

  • String arrays (["a","b"]) — string is a class, so string arrays are object arrays; use string scalars only

  • Handle class instantiation in loops — create before the loop

  • No dynamic dispatch at runtime — subclass must be chosen at compile time

  • No recursive class construction — use struct arrays with index-based relationships

  • No variable-size properties in handle classes — must have fixed sizes

  • Direct class code generation is supported via coder.ClassSignature (R2026a+); on older releases, wrap the class in a function entry point

  • Handle objects cannot be entry-point I/O (including nested in structs/cells/value classes)

  • Constructor: single output only, no nested functions

  • Cannot use coder.extrinsic on class/method; cannot pass class to coder.ceval

  • Cannot overload subsref/subsasgn/subsindex

  • No diamond-shaped inheritance; no events/listeners; no AbortSet

  • Global variables cannot be handle objects

See write-class-limitations.md for full details and workarounds.

datetime/duration/timetable key constraints: No text inputs for construction; no 'Format'/'TimeZone' on datetime; no growth/deletion by assignment; no conversion to text. timetable: must specify 'VariableNames', cannot restructure after creation. See write-temporal-types.md for details.

Checking function support: Look for the "Extended Capabilities - C/C++ Code Generation" section on any function's documentation page.

Specify dimension arguments explicitly: find, all, any, sum, max, min, mean — always pass explicit dimension.

flag = all(mask, 1);     % GOOD: explicit dimension
colSums = sum(A, 1);    % 1-by-n result
idx = find(x > 0, numel(x));  % with max count

Dual-purpose functions (e.g., diag): Force unambiguous input shape — diag(x(:)) always constructs.

Dynamic struct field access requires compile-time constant field names:

val = s.(coder.const(getFieldName(idx)));  % compile-time constant
% Or use switch for runtime selection
switch idx, case 1, val = s.alpha; case 2, val = s.beta; end

11. Specify Entry-Point Input Types

All entry-point inputs must have types defined. Cannot be entry-point inputs: function handles, handle class instances.

Function handles work within generated code only. For entry-points needing a callable, use a wrapper or enum dispatch:

% GOOD: wrapper with constant handle
function y = processSin(x) %#codegen
    y = process(x, @sin);
end
function y = process(x, func)
    y = feval(func, x);
end

% GOOD: enum/selector dispatch
function y = process(x, mode) %#codegen
    arguments, x (1,:) double; mode (1,1) uint32; end
    switch mode
        case uint32(1), y = sin(x);
        case uint32(2), y = cos(x);
        otherwise, y = x;
    end
end

Prefer feval for calling function handle/name arguments internally.

Input validation: Prefer arguments block over validateattributes — generates more optimized code because codegen uses declared types/sizes directly for inference.

% arguments block (preferred)
function y = myFunc(x, n) %#codegen
    arguments, x (1,:) double; n (1,1) uint32; end
    y = x(1:n);
end

Copyright 2026 The MathWorks, Inc.


Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
MathWorks
Publisher
MathWorks (Official)
Source
matlab/matlab-agentic-toolkit · skills-catalog/code-generation/matlab-generate-code · commit 2a7f215
Licence
BSD 2-Clause License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE.md)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by MathWorks or MathWorks.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download matlab-generate-code.zip