What problem does it solve?
MATLAB parfor loops enforce strict variable classification rules (sliced, broadcast, reduction, temporary) that are easy to violate and hard to reason about from memory. This Skill uses MATLAB's code analyser as the authoritative classifier to pinpoint the exact error and apply a proven fix pattern, instead of guessing at classification rules.
Core Features & Use Cases
- Analyser-driven diagnosis: Runs the MATLAB code analyser (checkcode/codeIssues via the MATLAB MCP tool) to get the exact parfor error before attempting any fix.
- Seven fix patterns: Covers struct-field slicing, multiple sliced subscripts, invalid sliced indexing, sliced-write/full-read conflicts, non-standard reductions, temporary variable issues, and conditional updates that must survive the loop.
- Full message catalog: A reference file maps all 48 parfor analyser message IDs (PFUNK, PFSLO, PFTUS, etc.) to root causes and fixes.
- Use Case: A user converts a for loop to parfor and gets "Unable to classify variable 'out'". The Skill runs the analyser, identifies that struct fields cannot be sliced, and rewrites the loop to accumulate into plain arrays before packing the struct after the loop.
Quick Start
Ask the agent to diagnose why the parfor loop in your MATLAB file fails to run and fix the variable classification errors.