matlab
它能做什么
这个工具可以帮你处理 MATLAB 和 GNU Octave 代码。它能检查、整理并规划这些代码的运行方式,尤其适用于数值计算和数据处理。
适用场景
- ✓当你需要检查 MATLAB/Octave 代码是否正确时。
- ✓当你在规划一个数值编程项目的组织结构时。
- ✓当你需要把代码从旧版本迁移到新版本时。
技能链接
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/matlab/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请检查这段 MATLAB 代码,确认它能正确计算数据集的平均值。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会分析你的代码,检查它是否遵循最佳实践和安全规则。它不会直接运行代码,而是通过审查来发现潜在问题或可以改进的地方。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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
unknownuntil 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:
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
- 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.
- Inventory statically. Scan
.mfiles, opaque artifacts, project paths, required products, and MAT headers before any runtime loads them. - Choose code form. Prefer functions with an
argumentsblock for automation. Use scripts only for controlled orchestration and live scripts for reviewed interactive narratives. - Make semantics explicit. Record shapes, classes, units, missing-value rules, indexing, implicit expansion, RNG algorithm/seed, tolerances, and output formats.
- Test without hidden state. Keep fixtures synthetic, paths project-local, graphics deterministic, and tests independent of base-workspace residue.
- Plan execution. Generate an argv plan, review startup/path effects and licenses, and launch only after explicit approval outside these helpers.
- 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.mfor static inspection.
…
常见问题
MATLAB 和 GNU Octave 有什么区别?
MATLAB 是付费的专有软件,而 GNU Octave 是免费的开源替代品。两者很相似,但并不完全相同,可能存在兼容性差异。
AI 能运行我的代码吗?
不能。这个工具是用来分析和规划的,并不负责执行代码。它只是在不运行代码的前提下安全地检查代码。
什么是“数值计算工作流”?
它指的是编程中用来完成数学计算和数据分析(尤其是数值计算)的一系列步骤或指令。
详情
作者的原始描述
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.
热度
- GitHub 星标
- 51k
- 排名
- #3496
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …