Diagnose MATLAB errors and unexpected behavior. Breakpoints, workspace inspection, try-catch diagnostics, and common error patterns.
SkillScore52Maintained
Automatic
◆Coding pack
Last verified 8/16/2026
What it changes
Passed 6 of 12 test cases with the skill, and 6 of 12 without it.
Without skill48%
With skill52%
Checks it passed that the model alone missed
Advises against using the MATLAB type command.
Warns against running the restoredefaultpath command.
Recommends using line breakpoints with dbstop instead.
and 7 more in the full report
6 fixed6 passed either way6 still failing5 broke
Pass-rate lift
+4 pp
Tokens
+182%
Agent turns
0%
Response time
-46%
Model gemini-3.6-flashMeasured 8/16/2026v112 of 23 cases passed with skill · 12 comparable
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 6 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 6
Prompt
I need to execute a full script file named calculate_orbit_trajectory.m to reproduce a workspace state. Should I pass the full script text to evaluate_matlab_code or use run_matlab_file?
What was checked, without and with the skill
Checked
Without skill
With skill
Recommends using mcp__matlab__run_matlab_file to run script files.
Missed
Passed
case-10 · 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.md280 linessingle file
Investigating and Debugging MATLAB Code with MCP Tools
You have access to a live MATLAB session via MCP tools. Use them to actively
investigate code — whether debugging errors, understanding behavior, or answering
questions about how MATLAB code works. Don't just guess from code alone.
When to Use
User encounters a MATLAB error message or unexpected result
User wants to set breakpoints or inspect variable state
Tracing why a function produces wrong output
NaN/Inf values appearing unexpectedly
A MATLAB MCP tool returns an error or exception — including runtime errors, syntax errors, undefined function/variable errors, or failed test results
User asks "why is my MATLAB code not working", "help me debug", or shares a MATLAB stack trace
When NOT to Use
Code quality review without a runtime problem — use matlab-reviewing-code instead
Performance profiling — use performance optimization workflows
Writing tests for correctness — use matlab-testing instead
Understanding MATLAB APIs or language features without a specific bug
Static Analysis vs Runtime Debugging
Not every issue needs the live MATLAB session. Choose the right approach:
Static analysis is enough when: syntax errors, unused variables, obvious
logic mistakes, or issues visible from reading the source code alone. Use the
Read tool and check_matlab_code.
Runtime debugging is needed when:
The error depends on actual data values, types, or dimensions
The output is wrong but the code looks correct
The user says "it doesn't work" but the code looks fine — check actual data
You need to know what variables contain at a specific point in execution
When in doubt, start with static analysis. Escalate to runtime debugging when
you can't determine the root cause from source alone.