Home / Market / matlab

matlab

Builds, reviews, migrates, and plans MATLAB or GNU Octave numerical workflows. Use for arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.

skill★ 595182342 dlskills.shMITInstall in CosmosUpstream Source

Documentation & Preview

--- name: matlab description: Builds, reviews, migrates, and plans MATLAB or GNU Octave numerical workflows. Use for arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability. license: MIT compatibility: >- Documentation is pinned where noted to proprietary MATLAB R2026a and free GNU Octave 11.3.0. Bundled Python CLIs require Python 3.11+ and run locally without MATLAB or Octave; optional MAT inventory uses scipy and/or h5py. allowed-tools: Read Write Bash Glob Python metadata: version: "1.4" skill-author: "K-Dense Inc." last-reviewed: "2026-10-01"

---

MATLAB and GNU Octave

Use this skill to design or review numerical code, migrate MATLAB releases, prepare reproducible projects, and plan trusted execution. MATLAB and GNU Octave are distinct products: compatibility is partial, not a license or behavior guarantee.

Review scope

Reviewed against current MathWorks R2026b documentation and GNU Octave 11.3.0 sources on 2026-10-01. The bundled Engine planner and MATLAB examples retain an explicit R2026a baseline. R2026b supports CPython 3.10-3.14; do not reuse the R2026a Engine package for it. MATLAB/Octave examples are illustrative and were not executed in this review; the Python helpers have local synthetic tests. This skill uses local runtime APIs, with no remote service endpoint or API key.

Product and license gate

named toolbox, MATLAB Test, MATLAB Compiler, MATLAB Coder, Parallel Computing Toolbox, or an add-on is installed, licensed, or available to the user.

with MATLAB Compiler; it cannot run arbitrary source or host MATLAB Engine for Python. Building artifacts needs the applicable licensed compiler and every product used by the source.

MATLAB toolboxes. Similar names do not imply API, numerical, graphics, or licensing equivalence.

the user actually has. Treat availability as unknown until confirmed.

See Octave compatibility and execution/product boundaries.

Nonnegotiable safety boundary

Never run an untrusted .m, .mlx, MEX binary, MAT file, project startup or shutdown action, package installer, or generated artifact. Static review does not prove safety.

Treat these as execution or code-loading surfaces:

timers, app callbacks, and dynamically modified paths;

pyrun, pyrunfile), MEX, and native libraries;

generated code;

handles, Java/System objects, and class code reachable from MAT files.

.mlx is an opaque archive for this toolkit and MEX is native executable code. Do not use Python pickle for exchange. Inspect first, isolate when appropriate, obtain explicit approval, then invoke a user-confirmed executable and license. Bundled scripts are static or dry-run tools: none launches MATLAB, Octave, Python Engine, a compiler, or a subprocess.

Default workflow

  1. Clarify target. Record MATLAB release or Octave version, OS/architecture,

base product versus required toolboxes/packages, expected inputs/outputs, numerical tolerances, and whether execution is authorized.

  1. Inventory statically. Scan .m files, opaque artifacts, project paths,

required products, and MAT headers before any runtime loads them.

  1. Choose code form. Prefer functions with an arguments block for

automation. Use scripts only for controlled orchestration and live scripts for reviewed interactive narratives.

  1. Make semantics explicit. Record shapes, classes, units, missing-value

rules, indexing, implicit expansion, RNG algorithm/seed, tolerances, and output formats.

  1. Test without hidden state. Keep fixtures synthetic, paths project-local,

graphics deterministic, and tests independent of base-workspace residue.

  1. Plan execution. Generate an argv plan, review startup/path effects and

licenses, and launch only after explicit approval outside these helpers.

  1. Capture provenance. Hash named inputs/code and record release, products,

RNG policy, tolerances, and command plan without dumping the environment.

Language and data checklist

Scripts, functions, and live scripts

Functions have local workspaces and explicit inputs/outputs.

review artifacts. Export reviewed code to .m for static inspection.

variables, and silent name shadowing. Use project roots and fullfile.

type declarations can convert inputs and size declarations can reshape or expand compatible inputs; validators check without converting.

are private to the file; since R2024a they can appear anywhere in a script outside conditional contexts.

function y = scaleSignal(x, options)
arguments
    x (:,1) double {mustBeFinite}
    options.Scale (1,1) double {mustBeFinite, mustBeNonzero} = 1
end
y = x .* options.Scale;
end

Read programming.

Arrays, indexing, and numerics

A{...}, and A.(name) have different semantics.

element-wise. Use A\b, not inv(A)*b.

backslash can continue after a singularity warning, and a small residual alone does not establish an accurate solution. For underdetermined systems, state whether minimum norm is required (lsqminnorm), rather than assuming A\b returns it. See the mldivide contract.

before operations that could accidentally form an outer result.

huge temporaries or unreadable code. Measure with timeit or the profiler.

tolerances, not blanket == or a magic multiple of eps.

independent parallel work; do not use time-based rng("shuffle") for a reproducibility claim.

Read arrays and mathematics.

Tables, timetables, and missing values

T(rows,vars) returns a table; T{rows,vars} extracts contents; T.Var selects one variable.

uniqueness, then use retime/synchronize intentionally.

<undefined>, and empty character vectors. Integer and logical arrays have no standard missing sentinel.

Preserve units, time zones, variable names, encodings, and missing rules.

Read data import/export.

Graphics and export

Use explicit figure/axes handles and tiledlayout; label units; set limits, color scales, font sizes, and colormaps deliberately. Prefer exportgraphics over saveas for publication output. In R2026a it exports raster, PDF/EPS/EMF, SVG, GIF, and interactive HTML; format capabilities differ. Specify ContentType="vector" for PDF/EPS/EMF; SVG is selected by its extension. Use Resolution for raster output. Review accessibility and embedded-raster behavior.

Read graphics and export.

MAT files and exchange

Versions 4/6/7/7.3 differ in types, compression, and per-variable limits. Users can change the save default in settings, so specify -v7 or -v7.3 explicitly in reproducible exchange workflows.

Partial access and chunking can help large arrays.

can invoke class deserialization behavior; opaque/function/native content requires escalation.

Do not rename pickle payloads as MAT files and do not deserialize pickle.

Read data import/export.

Projects, analysis, and tests

dependencies, source control, and reproducible entry points. Review project actions before opening an untrusted project.

static approximations; dynamic dispatch can cause misses or false positives. A required-product report does not prove a license is available.

and codeCompatibilityReport before migration.

matlab.unittest workflows. Parallel runs require Parallel Computing Toolbox. Dependency-based selection, richer quality dashboards, generated tests, and advanced coverage/equivalence features can require MATLAB Test or other products.

tests belong to a project that is not already open. Account for startup and shutdown actions before using this behavior.

Read programming and execution/testing.

Python integration, pinned to R2026a

MATLAB Engine for Python, and MATLAB Compiler SDK for Python.

matlabengine==26.1.12 (released 2026-05-08). It requires an installed R2026a; MATLAB Runtime alone is insufficient. R2026a also ships a preinstalled Engine distribution under one named matlabroot path.

one named interpreter/executable; do not print the full environment, PATH, PYTHONPATH, or credentials.

generally requires restarting MATLAB to switch; out-of-process Python can be terminated and reconfigured.

matlab.engine.start_matlab() starts a MATLAB process and can check out a license. Never call it merely to probe availability.

tables/timetables, strings/missing values, datetime/duration, dictionaries, shape/order, and unsupported sparse/object/categorical cases.

Read Python integration.

Local helper CLIs

Every helper is network-free, bounded, symlink-rejecting, and nonexecuting. Run from this skill directory with Python 3.11+. Bash i