Install
openclaw skills install matlab-simulation-optimizer-skillAudit and optimize MATLAB simulation programs against a corresponding academic paper or specification. Use when Codex needs to compare local MATLAB simulation source code with a paper, verify the system model, algorithm fidelity, parameters, iteration and stopping conditions, metrics, and experiments, directly improve the source code for correctness and runtime while preserving paper-mandated algorithm logic and parameters, and generate a Chinese modification summary document.
openclaw skills install matlab-simulation-optimizer-skillUse this skill to turn a local MATLAB simulation into a more faithful and faster implementation of its reference paper. The agent must compare the paper and source code, edit the MATLAB source directly, preserve paper-mandated conditions, verify the changes, and write a summary document recording all modifications.
Ask only for missing inputs that block the work:
.m files, scripts, functions, data, and run command.If the paper or MATLAB source folder is missing, ask for it before making conclusions or editing files.
Write the final summary document to the MATLAB simulation source root unless the user requests another location. Use optimization_summary.md by default. If the source root cannot be identified, ask the user for the target output folder before writing the summary.
Build the paper contract
paper-explicit, caption/table, algorithm-box, derived, or inferred.references/matlab-audit-checklist.md.Map the MATLAB program
main.m, main_*.m, run_*.m, demo_*.m, Fig*.m, plot_*.m, and top-level functions with no required inputs.python <skill-dir>/scripts/matlab_static_scan.py "<matlab-source-root>" --out "<matlab-source-root>/matlab_static_scan.json"
clear all, unseeded randomness, hard-coded constants, duplicated simulation loops, repeated file I/O, and plotting inside computation loops.Paper item | Paper requirement | Code location | Code behavior | Severity | Planned action
Paper result | Target metric/curve | MATLAB main entry | Called algorithm files | Output file/figure | Status
mapped, partially mapped, missing, or unclear.Plan safe code edits
Correctness: required to match the paper;Performance: mathematically equivalent speed/memory improvement;Cleanup: removes comments, code, plotting, output, or helper artifacts that are not used for generating paper simulation results;Reproducibility: seed, logging, result saving, deterministic output;Maintainability: structure, comments, duplicate removal.Optimize MATLAB source
inv(A)*b with A\b and avoiding explicit matrix inverse where equivalent;parfor only when parallel toolbox availability is known and random streams remain reproducible;Verify
Write the summary document
optimization_summary.md in the MATLAB source root.Use this structure for optimization_summary.md:
# MATLAB 仿真程序优化总结
## 输入材料
- 论文:
- MATLAB 程序目录:
- 主要入口:
## 论文硬性条件核对
| 项目 | 论文要求 | 代码位置 | 处理结果 |
|---|---|---|---|
## 论文仿真结果与主函数对应关系
| 论文结果 | 指标/曲线 | MATLAB 主入口 | 调用的算法文件 | 输出文件/图 | 状态 |
|---|---|---|---|---|---|
## 修改清单
| 文件 | 类型 | 修改内容 | 原因 | 是否改变论文算法 |
|---|---|---|---|---|
## 正确性修复
- ...
## 运行速度优化
- ...
## 无用内容清理
| 文件 | 删除内容 | 判定为无用的依据 | 是否影响论文结果 |
|---|---|---|---|
## 验证结果
- 运行命令:
- 对比结果:
- 剩余差异:
## 保留不变的论文条件
- ...
## 后续建议
- ...
cfg or parameter struct when the project already has one; do not scatter new constants.parfor, use controlled streams rather than accidental shared randomness.single precision unless the paper or user permits it.tic/toc, timeit, MATLAB profiler, or reduced-size deterministic runs before claiming speedups.If the task is only to audit code without editing, simulation-paper-auditor may be enough. If the user asks to create MATLAB code from a paper from scratch, use paper-matlab-reproduction. Use this skill when the central request is to optimize an existing MATLAB simulation source program while preserving paper fidelity.
After each execution of this Skill:
diary/YYYY-MM-DD.md.SKILL.md.