matlab – skill Lập trình cho agent AI
Xây dựng, rà soát, di chuyển và lập kế hoạch quy trình tính toán số MATLAB hoặc GNU Octave. Dùng cho mảng, dữ liệu dạng bảng/chuỗi thời gian, kiểm thử, dự án, đồ họa, file MAT và tương tác Python rõ ràng.
Cài skill matlab bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/matlab-bb1be.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /matlab – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/matlab-bb1be.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $matlab – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/matlab-bb1be.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /matlab – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/matlab-bb1be.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /matlab – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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
- MATLAB R2026a is proprietary. Do not assume MATLAB, MATLAB Online, a
named toolbox, MATLAB Test, MATLAB Compiler, MATLAB Coder, Parallel Computing
Toolbox, or an add-on is installed, licensed, or available to the user.
- MATLAB Runtime is not MATLAB. It runs compatible applications produced
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.
- GNU Octave 11.3.0 is free software under GPLv3+. Octave packages are not
MATLAB toolboxes. Similar names do not imply API, numerical, graphics, or
licensing equivalence.
- Ask which runtime, release, platform, installed products, and license context
the user actually has. Treat availability as unknown until confirmed.
See [Octave compatibility](references/octave-compatibility.md) and
[execution/product boundaries](references/executing-scripts.md).
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:
eval,evalin,assignin, text-derivedfeval,str2func, callbacks,
timers, app callbacks, and dynamically modified paths;
system,unix,dos, shell escape!, Java, .NET, Python (py.*,
pyrun, pyrunfile), MEX, and native libraries;
mex,codegen, MATLAB Compiler, build tasks, package/project startup, and
generated code;
load, object deserialization (loadobj, custom serialization), function
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.
2. Inventory statically. Scan .m files, opaque artifacts, project paths,
required products, and MAT headers before any runtime loads them.
3. Choose code form. Prefer functions with an arguments block for
automation. Use scripts only for controlled orchestration and live scripts
for reviewed interactive narratives.
4. Make semantics explicit. Record shapes, classes, units, missing-value
rules, indexing, implicit expansion, RNG algorithm/seed, tolerances, and
output formats.
5. Test without hidden state. Keep fixtures synthetic, paths project-local,
graphics deterministic, and tests independent of base-workspace residue.
6. Plan execution. Generate an argv plan, review startup/path effects and
licenses, and launch only after explicit approval outside these helpers.
7. 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
- Scripts share the caller/base workspace and leave variables behind.
Functions have local workspaces and explicit inputs/outputs.
- Live scripts (
.mlx) mix code and rich output but are not plain-text
review artifacts. Export reviewed code to .m for static inspection.
- Avoid
clear all, broadaddpath(genpath(...)), dependence onpwd, global
variables, and silent name shadowing. Use project roots and fullfile.
- Validate sizes, classes, and values in
argumentsblocks. Remember that
type declarations can convert inputs and size declarations can reshape or
expand compatible inputs; validators check without converting.
- A main function file should match the main function name. Local functions
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;
endRead [programming](references/programming.md).
Arrays, indexing, and numerics
- MATLAB uses 1-based, column-major indexing.
A(i,j),A(k),A(:,j),
A{...}, and A.(name) have different semantics.
*,/,\, and^are matrix operations; dotted forms are
element-wise. Use A\b, not inv(A)*b.
- After a linear solve, inspect conditioning/rank and a scale-aware residual;
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](https://www.mathworks.com/help/matlab/ref/double.mldivide.html).
- Since R2016b, compatible dimensions expand implicitly. Assert intended shape
before operations that could accidentally form an outer result.
- Preallocate when output size is known, but do not vectorize at the cost of
huge temporaries or unreadable code. Measure with timeit or the profiler.
- Compare floating-point results with domain-chosen absolute and relative
tolerances, not blanket == or a magic multiple of eps.
- Pin both random algorithm and seed. Use named
RandStreamsubstreams for
independent parallel work; do not use time-based rng("shuffle") for a
reproducibility claim.
Read [arrays](references/matrices-arrays.md) and
[mathematics](references/mathematics.md).
Tables, timetables, and missing values
- A
tablehas named, equal-height variables that may have different types.
T(rows,vars) returns a table; T{rows,vars} extracts contents; T.Var
selects one variable.
- A
timetableadditionally has row times. Sort, validate time zones and
uniqueness, then use retime/synchronize intentionally.
- Missing sentinels are type-specific:
NaN,NaT,<missing>,
<undefined>, and empty character vectors. Integer and logical arrays have
no standard missing sentinel.
- Define import options rather than relying on inference for production data.
Preserve units, time zones, variable names, encodings, and missing rules.
Read [data import/export](references/data-import-export.md).
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](references/graphics-visualization.md).
MAT files and exchange
- Version 7 is the normal
savedefault;matfilecreates 7.3 by default.
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.
- Version 7.3 is HDF5-based, not an arbitrary HDF5 interchange contract.
Partial access and chunking can help large arrays.
- Never load an untrusted MAT file. Inventory headers/datasets first. Objects
can invoke class deserialization behavior; opaque/function/native content
requires escalation.
- Prefer CSV/JSON/Parquet/HDF5 with a documented schema for simple exchange.
Do not rename pickle payloads as MAT files and do not deserialize pickle.
Read [data import/export](references/data-import-export.md).
Projects, analysis, and tests
- Use MATLAB Projects for controlled paths, startup/shutdown tasks,
dependencies, source control, and reproducible entry points. Review project
actions before opening an untrusted project.
-
… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- azure-communication-sms-java – Gửi tin nhắn SMS với SDK Java của Azure Communication Services SMS. Dùng khi triển khai…
- azure-compute-batch-java – SDK Azure Batch cho Java. Chạy các job xử lý song song và HPC quy mô lớn với pool, job…
- azure-cosmos-java – SDK Azure Cosmos DB cho Java. Thao tác cơ sở dữ liệu NoSQL với phân tán toàn cầu, hỗ trợ…
- azure-cosmos-rust – SDK Azure Cosmos DB cho Rust (NoSQL API). Dùng cho thao tác CRUD tài liệu, truy vấn…
- azure-data-tables-java – Xây dựng ứng dụng table storage bằng SDK Azure Tables cho Java. Hoạt động với cả Azure…
- azure-eventhub-java – Xây dựng ứng dụng streaming thời gian thực bằng SDK Azure Event Hubs cho Java. Dùng khi…
- coverage – Phân tích khoảng trống độ phủ test. Dùng khi người dùng nói "test coverage", "what's not…
- hunt-open-redirect – Săn Open Redirect — mọi loại, kể cả mức ảnh hưởng thấp, chuỗi tới đánh cắp token OAuth →…