AI Blocks › Build and ship software
Function argument checker writer
Give it a MATLAB function. Get its inputs checked with a clean arguments block, replacing older checks.
Function argument checker writer is a free AI skill for the job "Build and ship software". Give the instructions to an AI assistant that supports the required files and tools, then review its output.
Free · No account · BSD 2 Clause licence · Made by MathWorks
Made by MathWorks. See the original on GitHub; we copied it as it is, with its licence.
What it does
A MATLAB function whose inputs are checked with a clean arguments block, replacing older checks like inputParser. Bad inputs are rejected with clear errors instead of silently reshaped. It writes the block with the right size, class and validator for each input. It handles repeating arguments, name-value options, and copying properties into class constructors. It also warns about quiet conversions where MATLAB changes the size or class of what you pass in, and tightens rules so a scalar means a scalar. It leaves ordinary guard checks inside the function body alone.
You give it
- MATLAB function or class
- Expected types, sizes and ranges for each input
- Defaults for optional inputs (optional)
You get
- Rewritten function with an arguments block
- Validators for each input
- Handling for repeating and name-value arguments
- Warnings on silent conversions
Use it when
- You want to replace inputParser or validateattributes with an arguments block.
- Your function accepts wrong types and fails far down the code.
- You need name-value options passed on to another function.
- You are tightening a function's inputs before sharing it.
How to use it
- Add it to your AI once: download it and add the folder to Claude, ChatGPT or Codex as a skill.
- Ask for the job in your own words. Your AI opens the skill when it fits.
- It works best when your AI can run MATLAB.