Use when writing MATLAB functions with arguments blocks — repeating arguments (arguments (Repeating)), .?ClassName property import in constructors, name-value forwarding with namedargs2cell, or migrating from inputParser or validateattributes. Also when reviewing signatures for implicit-conversion pitfalls (size reshaping, class coercion, computed defaults), or when restricting, constraining, or validating function inputs — scalar vs vector enforcement, type rejection, size checking. Also when a
SkillScore100Maintained
Automatic
◆Coding pack
Last verified 9/2/2026
What it changes
Passed 22 of 22 test cases with the skill, and 19 of 22 without it.
Without skill86%
With skill100%
Checks it passed that the model alone missed
The mustBeBetween validator specifies range bounds 0 and 1.
The arguments block uses the mustBeBetween validator for alpha.
The argument validation block omits the (1,:) size specification on x.
and 1 more in the full report
3 fixed19 passed either way0 still failing0 broke
Pass-rate lift
+14 pp
Tokens
+230%
Agent turns
0%
Response time
-12%
Model gemini-3.6-flashMeasured 9/2/2026v322 of 22 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
Write a MATLAB argument validation block for a parameter `alpha` requiring a scalar float bounded between 0.0 and 1.0 inclusive, using the built-in range validator introduced in MATLAB R2025a.
What was checked, without and with the skill
Checked
Without skill
With skill
The arguments block uses the mustBeBetween validator for alpha.
Missed
Passed
The mustBeBetween validator specifies range bounds 0 and 1.
Missed
Passed
case-19 · gemini-3.6-flash · 9/2/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md452 lines3 files
MATLAB Function Argument Validation
Write robust MATLAB functions using arguments blocks with correct semantics for size, class, repeating arguments, and property import.
When to Use
Writing a function with an arguments block
Using repeating arguments (arguments (Repeating))
Writing a class constructor that accepts name-value arguments
Migrating from inputParser or validateattributes
Reviewing a function signature for implicit conversion pitfalls
Choosing between class specs, mustBeA, and validators
When NOT to Use
Basic MATLAB programming without argument validation
App building or UI components (use matlab-building-apps)
Unit testing (use matlab-write-test)
General OOP class design unrelated to argument validation
Simple if/error guard clauses for runtime invariants inside a function body
(those aren't input validation — leave them as-is unless the user asks for an
arguments block specifically)
.mlx (Live Script) or .mlapp (App Designer) files — these are binary
ZIP containers. Don't unzip them or attempt structural edits. If the user
asks to add an arguments block to a function inside one, ask them to
export to plain .m first, or open the file in MATLAB and edit it there.
Critical Misconceptions
These are things the agent commonly gets wrong. Read these FIRST.
Size specs RESHAPE, not reject
WRONG belief:(1,:) rejects column vectors with an error.
ACTUAL behavior: MATLAB silently reshapes the input to fit the declared size.