Adds, configures, and manages faults on Simulink/Simscape/System Composer model signals for robustness analysis and safety validation. Covers stuck, noise, gain, offset faults, FMEA validation, and fault simulation.
Ships in verification-validation-and-test. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use evaluate_matlab_code with the Simulink.fault API to programmatically inject faults into Simulink models. Faults override signal values at block ports to simulate hardware failures, sensor faults, and actuator malfunctions.
manage-safety-analysisbuilding-simulink-modelssimulating-simulink-modelstesting-simulink-modelshasFA = ~isempty(which('Simulink.fault.addFault'));
fprintf('Simulink Fault Analyzer available: %d\n', hasFA);
references/fault-behaviors.md)..slx file containing fault behavior subsystem(s).<ModelName>_faultInfo.xml stores all fault metadata alongside the model.get_param(blockPath, 'PortHandles')._faultInfo.xml files. Always use MATLAB APIs to modify fault definitions.addBehavior) must also be a valid MATLAB identifier.Simulink.fault.deleteAll or Simulink.fault.deleteFault to toggle faults on/off for simulation. Deleting faults destroys fault objects, their behavior models (.slx files), and their traceability links permanently. Use Simulink.fault.injection(model, false) to disable ALL fault injection for a nominal run, and Simulink.fault.injection(model, true) to re-enable. Use Simulink.fault.enable(modelElement, false) to disable faults on specific elements.model_overview and model_read to identify fragile signal paths -- single-point actuators, sensor feedback, computed quantities with wide fan-out.references/preflight-and-adding-faults.md.get_param(blk, 'PortHandles').Simulink.fault.addFault(portHandle, Name=..., Description=...). See references/preflight-and-adding-faults.md.addBehavior(fault, modelName, FaultBehavior='mwfaultlib/...'). See references/fault-behaviors.md.fault.TriggerType and the corresponding properties (e.g., StartTime for Timed, Conditional for Conditional, TriggerActive for Manual). See references/triggers-and-conditionals.md.Simulink.fault.save('ModelName').Simulink.fault.injection(mdl, true) then sim(...). See references/simulation-workflows.md.model_read to identify target blocks before injecting faultsreferences/preflight-and-adding-faults.md)Simulink.fault.save('ModelName') after any fault changesactivate(fault)Simulink.fault.injection(mdl, false)mwfaultlib behaviorSimulink.fault.Fault() constructor -- use Simulink.fault.addFault() insteadmwfaultlib/Stuck-at-Ground) as the fault model name argument to addBehavior -- use the FaultBehavior name-value pairfault.Persistent = true -- it makes the fault irreversible during simulation| Issue | Cause | Fix |
|---|---|---|
Assertion failed in Simulink.fault.Fault() | Do not use the Fault() constructor directly | Use Simulink.fault.addFault(portHandle, Name=..., Description=...) instead |
Fault name must follow MATLAB variable naming conventions | Name contains spaces or special chars | Use camelCase/PascalCase with no spaces (e.g., SensorStuckAtZero) |
Invalid name for a fault model | Behavior model name has invalid characters | Use a simple MATLAB identifier (e.g., StuckAtZero, not Stuck-at-Zero) |
Unable to add fault... only to block input or output ports | Passed a block path/handle instead of port handle | Use ph = get_param(blockPath, 'PortHandles'); ph.Outport(1) |
Target signal is a continuous-time signal | Fault Analyzer cannot inject on continuous signals going to continuous blocks | See Continuous-Time Signal Decision Tree in references/advanced-operations.md |
Output dimensions do not match or Data type mismatch | Fault constant size/type ≠ target signal | See "Vector and Matrix Fault Values" in references/fault-behaviors.md |
| Bus signal fault fails with non-Ground behavior | Most mwfaultlib behaviors are scalar-only | Use Stuck-at-Ground for full bus, or use BusElement to target individual elements |
| Multiple faults on same port but only one fires | Only one fault per port is active at a time | Use activate(fault) to select, or use different StartTime values |
| Fault exists but simulation runs nominally | Fault injection not enabled or fault not active | Call Simulink.fault.injection('Model', true) and activate(f) |
| File | Contents |
|---|---|
references/preflight-and-adding-faults.md | Port inspection, compile checks, adding faults, port handle resolution, fault object properties/methods |
references/fault-behaviors.md | Built-in behaviors, custom behaviors, bus faults, vector/matrix faults, discovery, data inport source |
references/triggers-and-conditionals.md | Trigger types, conditional creation, conditional/symbol object properties |
references/simulation-workflows.md | Running simulations, nominal vs. faulted comparison, selective fault isolation |
references/advanced-operations.md | FMEA linking, reports, export, deletion, continuous-time workarounds, synchronizing faults from referenced models/subsystems/libraries |
references/test-case-integration.md | Adding fault sets to Simulink Test cases (R2024a+) |
Copyright 2026 The MathWorks, Inc.
manifest.yaml (opens in a new tab)references/advanced-operations.md (opens in a new tab)references/fault-behaviors.md (opens in a new tab)references/preflight-and-adding-faults.md (opens in a new tab)references/simulation-workflows.md (opens in a new tab)references/test-case-integration.md (opens in a new tab)references/triggers-and-conditionals.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
/verification-validation-and-test:inject-faultsfrom verification-validation-and-test
npx claudepluginhub matlab/simulink-agentic-toolkit --plugin verification-validation-and-test9 skills in this plugin
/author-modeladvisor-checksAuthor or upgrade Model Advisor checks for Simulink and System Composer models. Covers the full lifecycle: guideline authoring, check specification, Model Advisor check implementation, and qualification testing. Use when creating new checks (edit-time, standard batch, config-parameter, auto-fix), converting legacy StyleOne/StyleTwo/StyleThree checks to modern DetailStyle, creating a guideline for modeling, enforcing a modeling rule, or testing/qualifying a check. Triggers on any modeling constraint (e.g., "blocks shall...", "signals must match...", "parameters shall be set to...").
/checking-model-complianceUse this skill when the user asks to check Simulink model compliance against a standard (MISRA, MAB, JMAAB, ISO, DO, IEC, EN, CERT C/CWE, AUTOSAR, Simulink Code Inspector (SLCI)), wants to run Model Advisor checks, or needs a compliance report with fix suggestions. For JMAAB/MAB, supplement deterministic checks with agentic review of uncheckable guidelines./fix-sldv-incompatibilityUse when a Simulink model is incompatible with Simulink Design Verifier (sldvcompat returns false, or an SLDV analysis errors out on an unsupported construct) and needs to be made analyzable. Diagnoses the incompatibility, applies the matching fix to a copy, and confirms the copy is compatible; optionally raises confidence the fix preserved behavior via a back-to-back consistency replay (agreement on the generated tests, not a proof of equivalence). Do NOT use for running test generation, design error detection, or requirement verification themselves — only for making a model compatible so those can proceed./manage-safety-analysisCreate, populate, and manage safety analysis spreadsheets (FMEA, FHA, HARA, custom) and fault trees (FTA) in Safety Analysis Manager. Use when the user asks to perform FMEA, hazard analysis, fault tree analysis, safety analysis, or work with Safety Analysis Manager documents. Requires Simulink Fault Analyzer./resolve-design-errorsUse when asked to run Design Error Detection (quick defect scan), find design errors in a Simulink model, perform root cause analysis on DED findings, fix division-by-zero, overflow, dead logic or out-of-bounds defects detected by SLDV, or diagnose why missing coverage cannot be achieved (dead logic blocking coverage objectives). Do NOT use for requirement verification, test generation, Inf/NaN detection, active logic analysis, or coverage measurement./simulink-collect-metricsCollect and assess quality metrics for Simulink models using the metric.Engine API. Use when evaluating model design quality (maintainability, complexity, architecture) or testing completeness (unit testing, SIL, PIL, coverage, pass rates) after edits or test runs. Covers metric discovery, collection, report generation, and diagnostics. Triggers on: "collect metrics", "quality metrics", "metric.Engine", "testing metrics", "maintainability metrics", "SIL metrics", "PIL metrics", "what metrics are available", "assess quality", "coverage metrics", "generate metric report", "diagnose metric errors".
Other plugins' skills for the same job