Read BEFORE optimizing any MATLAB code for speed. Without this workflow, agents commonly optimize the wrong target, fabricate speedup claims without measurement, or introduce regressions. Guides the 7-step workflow: baseline, profile, identify, optimize, measure, verify, report.
SkillScore87Maintained
Automatic
◆Coding pack
Last verified 8/16/2026
What it changes
Passed 20 of 23 test cases with the skill, and 17 of 23 without it.
Without skill74%
With skill87%
Checks it passed that the model alone missed
Advises modifying and recompiling the underlying C source code.
Establishes baseline performance before profiling or introducing optimizations.
States that speedups below 1.2x are not reliably distinguishable from measurement noise.
and 1 more in the full report
3 fixed17 passed either way3 still failing0 broke
Pass-rate lift
+13 pp
Tokens
+68%
Agent turns
0%
Response time
-27%
Model gemini-3.6-flashMeasured 8/16/2026v120 of 23 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 3
Prompt
My MATLAB Monte Carlo simulation script (run_mc_sim.m) is running very slowly when evaluating 500,000 iterations. I want to profile its execution, fix the biggest bottleneck, verify the simulation results still match the original logic, and get a performance comparison report showing the speedup achieved. Could you guide me through this optimization process step-by-step with code snippets?
What was checked, without and with the skill
Checked
Without skill
With skill
Establishes baseline performance before profiling or introducing optimizations.
Missed
Passed
Uses timeit or explicit warmup to avoid timing JIT compilation overhead.
Passed
Passed
Includes profile on to profile function execution.
Passed
Passed
case-02 · gemini-3.6-flash · 8/16/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md200 lines3 files
MATLAB Performance Optimization Workflow
Systematic 7-step workflow for finding and fixing performance bottlenecks in MATLAB code.
When to Use
User asks to speed up or optimize MATLAB code
User wants to find why their MATLAB code is slow
User has a function or script that takes too long to run
User asks to benchmark or time MATLAB code
User wants to compare performance before and after a change
User asks about MATLAB performance best practices
When NOT to Use
Optimizing Simulink model simulation speed (use Simulink Profiler)
The bottleneck is in compiled C/MEX code that can't be changed at the M-code level
The performance issue is purely I/O-bound (file reads, network, database)
User wants to write performance tests (use the writing-matlab-perf-tests skill)
The 7-Step Workflow
Step 1: Establish Baseline
Measure current performance so you have a number to improve against.
Read and write 3-D point cloud data using Lidar Toolbox file I/O. Covers PLY, PCD, LAS/LAZ, PCAP (Velodyne/Ouster/Hesai), E57, and IDC (Ibeo) formats. Use when loading point clouds from disk, saving to disk, choosing the correct reader or writer for a file format, extracting or preserving lidar point attributes, reading Ibeo IDC sensor recordings, or converting between formats.