MCPInstall
matlab avatar

simulink-manage-variant-configuration

Manage Simulink Variant Manager and Variant Configurations workflows — examine, list, and explore variant configurations, variant control variables, and variant model structure; create, modify, and delete variant configurations; validate variant constraints; generate valid variant configurations; apply, activate, or update models with variant configurations; compare variant configurations and analyze which blocks are active or different; open or close the Variant Manager UI; set up non-intrusive variant configuration specific simulation and testing with variant configurations; show/hide variant control variable usage. Use when working with variant configurations, variant manager, VCS objects (VariantConfigurationData / VariantConfigurations), variant control variables, preferred configuration, activation of variant choices, or reducing a variant model to selected variant configurations.

Installs
0
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill simulink-manage-variant-configuration
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads simulink-manage-variant-configuration automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

When to Use

  • Examining, listing, or exploring variant configurations, control variables, or variant structure of a Simulink model
  • Creating, modifying, or deleting variant configurations
  • Validating variant configurations against constraints
  • Generating valid valid configurations automatically
  • Applying, activating, or updating a model with a variant configuration
  • Comparing or analysing different variant configurations — which blocks are active, which differ, which are always active
  • Reducing a variant model to lock down specific designs i.e a model free from variants as much as possible (reduceModel)
  • Setting up non-intrusive simulation with variant configurations
  • Setting up non-intrusive testing with variant configurations
  • Setting or querying the preferred configuration
  • Showing or hiding variant control variable usage in a model
  • Opening or closing the Variant Manager UI

When NOT to Use

  • General simulation or testing workflows that do not involve variant configurations → use simulating-simulink-models, simulink-run-parallel-simulations, or testing-simulink-models
  • General Simulink model building or block-level editing, including creating or editing variant blocks (Variant Subsystem, Variant Source/Sink) → use building-simulink-models
  • Code generation for variant models → use simulink-configure-model-for-code-generation
  • Changing ActiveConfigurationSet or ConfigSet parameters (Simulink configuration sets, not variant configurations) → use building-simulink-models

Hard Rules

  • Onboard immediately. As soon as this skill is invoked, run Onboarding before doing anything else. Do NOT skip onboarding, as this will setup necessary context for other workflows. Onboarding is per model — if the user switches to a different model or changes attached variant configurations object, onboard again for that model.
  • Read the data model before touching configurations. Before any task that requires CRUD operations on variant configurations, constraints, or control variable values, read references/variant-configurations-data-model.md — including before following references/variant-configurations-operations.md. It defines the object structure, value unwrapping, and model-level control variable rules those tasks depend on.
  • One question at a time. Ask a single question, give your recommended answer with a one-line reason, and wait for the reply before asking the next. Continue until shared understanding is reached.
  • Finding facts is YOUR job, never the user's. Use tools to discover model state, variable names, enum values, dictionary contents, etc. Never ask the user to look something up that you can determine programmatically.
  • Never guess function syntax. Only use syntax documented in the reference files of this skill. If the function is not covered in a reference file, run help <functionName> in MATLAB to confirm the exact syntax before using it. Do NOT invent arguments or assume parameter names.
  • Never assume names exist — always verify first. Before using ANY property name, field name, class name, enum class name, method name, or parameter setting, verify it programmatically in MATLAB (e.g., using fieldnames, properties, methods, class, which, get_param). If you have not confirmed a name exists in the current session, you MUST NOT use it. Inspect first, act second. Exception: syntax and names explicitly documented in this skill's reference files can be assumed to be present.
  • Reload the UI once after all VCS mutations are complete. Changes made via evalin — adding, removing, or modifying configurations, constraints, or control variable values — are not visible in an open Variant Manager until reloadVariantConfigurationsInUI runs. Call it exactly once, at the end of the whole mutation sequence: adding three configurations means one reload, not three. Never call it per operation, inside a loop, after read-only operations, after applyConfiguration (which does not change the VCS), or after variantConfigActivateModel / variantConfigUpdateModel (which already sync the UI). Reload discards any unapplied edits in the UI and re-reads the VCS from its source. Changing which VCS is attached is not a state change and reload does not handle it — close and reopen the UI instead.
  • Never let unsaved VCS changes be discarded silently. Changes to the VCS live only in memory until they are saved: in a data dictionary they stay in the open dictionary until saveChanges is called, and in the base workspace they last only for the current MATLAB session. Do not save on your own initiative. Before running any code that closes data dictionaries with '-discard' — every simulation and testing workflow in this skill does — check for unsaved work and ask the user, one question at a time:
    • VCS in a data dictionary (vcsSource is 'data dictionary'): if Simulink.data.dictionary.open(slddFile).HasUnsavedChanges is true, ask whether to save the dictionary first. Call saveChanges only after the user confirms; if they decline, tell them the changes will be lost when the dictionary is discarded.
    • VCS in the base workspace: if it was modified in this session, recommend saving it to a MAT-file (for example save('<file>.mat', '<vcsName>') in the base workspace) so it can be reused in a later MATLAB session, and save only after the user confirms.
  • Suggest the Variant Manager UI for exploration. When the user is exploring variant structure (model hierarchy, variant components, configurations, control variables), suggest opening the Variant Manager UI. On R2026a+, use Simulink.VariantManager.open(model). On older releases, use the launchVariantManagerUI script. To close the UI, use the closeVariantManagerUI script. The UI displays model hierarchy, variant components, and configuration details far more effectively than programmatic inspection alone.
  • Preferred configuration is only a label. PreferredConfiguration records which configuration is regarded as preferred and has no functional effect: it does not activate, seed, or influence any variant operation. Never describe it as a default — its legacy name, DefaultConfiguration, invites that mistake.
  • Respect the MATLAB release. This is non-negotiable. Before calling any API, check its "Introduced" annotation in the reference files against the onboarded releaseVersion. If it is newer, do NOT use it — use the documented fallback or tell the user it is unavailable. Use Name=Value syntax only on R2026a+ and positional arguments on earlier releases; never mix the two.

Onboarding

Run this when the skill starts, and again whenever the target model changes. It establishes the facts every later step relies on: the MATLAB release, the target model, the variant configurations object (VCS) attached to the model, the data source that holds it, and the other VCS objects in that source. Determine them from MATLAB; ask the user only when no model, or more than one, is loaded.

Step 1: Release and Target Model

releaseVersion = version('-release');
modelNames = find_system('SearchDepth', 0);

if isempty(modelNames)
    error('No loaded Simulink model was found. Ask the user which model to open or use.');
elseif numel(modelNames) == 1
    modelName = modelNames{1};
else
    disp('Loaded models:');
    disp(modelNames(:));
    error('Multiple loaded models were found. Ask the user which model to use and store it as modelName.');
end

If several models are loaded, ask which one to use, store it in modelName, and continue with Step 2.

Step 2: Attached VCS, Its Source, and Peer VCS Objects

if ~isMATLABReleaseOlderThan('R2026b')
    vcsModelParam = 'VariantConfigurations';
    ddSectionName = 'Design Data';
    vcsClassName = 'Simulink.VariantConfigurations';
else
    vcsModelParam = 'VariantConfigurationObject';
    ddSectionName = 'Configurations';
    vcsClassName = 'Simulink.VariantConfigurationData';
end

vcsName = get_param(modelName, vcsModelParam);
slddFile = get_param(modelName, 'DataDictionary');

vcsLocation = '';
vcsSource = '';
availableVcsNames = {};

if ~isempty(char(slddFile))
    dictObj = Simulink.data.dictionary.open(slddFile);
    ddSection = getSection(dictObj, ddSectionName);
    entries = find(ddSection);

    for i = 1:numel(entries)
        if isa(getValue(entries(i)), vcsClassName)
            availableVcsNames{end+1} = entries(i).Name; %#ok<AGROW>
        end
    end

    if ismember(vcsName, availableVcsNames)
        vcsLocation = slddFile;
        vcsSource = 'data dictionary';
    end
end

% Check base workspace if the attached VCS was not found in the dictionary.
if isempty(vcsLocation) && ~isempty(vcsName)
    if evalin('base', sprintf('exist(''%s'', ''var'')', vcsName))
        if evalin('base', sprintf('isa(%s, ''%s'')', vcsName, vcsClassName))
            vcsLocation = 'base workspace';
            vcsSource = 'base workspace';
            if ~ismember(vcsName, availableVcsNames)
                availableVcsNames{end+1} = vcsName; %#ok<AGROW>
            end
        end
    end
end

otherVcsNames = setdiff(availableVcsNames, {vcsName}, 'stable');

fprintf('MATLAB release: %s\n', releaseVersion);
fprintf('Model: %s\n', modelName);
fprintf('Data dictionary: %s\n', slddFile);
fprintf('Attached VCS: %s\n', vcsName);
fprintf('Attached VCS location: %s\n', vcsLocation);
fprintf('Attached VCS source: %s\n', vcsSource);
fprintf('Other VCS objects in same source: %s\n', strjoin(otherVcsNames, ', '));

Report

Report the onboarding facts to the user in this format:

## Model: <modelName>

| Property | Value |
|----------|-------|
| MATLAB Release | <releaseVersion> |
| Model Name | <modelName or none> |
| Data Dictionary | <slddFile or none> |
| Attached Variant Configurations | <vcsName or none> |
| Attached VCS Location | <vcsLocation or not found> |
| Attached VCS Source | <vcsSource or not found> |
| Other VCS Objects In Same Source | <comma-separated names or none> |

Do not include configuration tables, constraints, or control-variable details in this report unless the user explicitly asked for them.


Workflow Router

After onboarding, determine user intent and route to the appropriate reference.

Disambiguation: Simulation vs Analysis vs Testing

User's focusRoute to
What output is produced for a named or implied variant configuration — signal values, behavior, plotting resultsSimulation
What variants are active — which blocks differ, active paths, structural comparisonAnalysis
Pass/fail verification — benchmarking, regression, baseline, test reportsTesting

Precondition — no variant configuration, no skill. Every row above presumes the request concerns a variant configuration. If the request names no configuration and none is implied (e.g. "simulate the model for 10 seconds and plot the output"), this skill does not apply: say so, do NOT onboard, use standard Simulink practice (sim / Simulink.SimulationInput), and do NOT call setVariantConfiguration or any other variant API. See When NOT to Use.

If ambiguous (e.g., "compare configurations"), ask the user: are they interested in simulation output values, structural differences between active variants, or pass/fail verification?

User intentRoute to
Inspect VCS structure, configurations, constraints, or stored valuesreferences/variant-configurations-data-model.md
Inspect model variant control variables (allowed values, enum members, sources, activation times)references/variant-configurations-data-model.md
Add/modify/remove a specific configuration (user describes exact values)references/variant-configurations-operations.md
Add/modify/remove constraintsreferences/variant-configurations-operations.md
Add/modify/remove control variablesreferences/variant-configurations-operations.md
Copy a configurationreferences/variant-configurations-operations.md
Set/get preferred configurationreferences/variant-configurations-operations.md
Check if a configuration is activereferences/variant-configurations-operations.md
Associate/query/remove referenced model configurationsreferences/variant-configurations-operations.md
Generate exhaustive valid combinations ("all possible", "every valid", "what combinations exist")references/variant-manager-operations.md (generateConfigurations)
Apply/activate/update model with a configurationreferences/variant-manager-operations.md
Validate a constraint against the modelreferences/variant-manager-operations.md
Analyze/compare configurations (active blocks, differences)references/variant-manager-operations.md → references/variant-configuration-analysis.md
Work with analysis object (active blocks, differences, dependent models)references/variant-configuration-analysis.md
Reduce model / lock down specific designsreferences/variant-manager-operations.md
Show/hide control variable usagereferences/variant-manager-operations.md
Attach a different variant configurations object to the modelSwitching the Attached VCS — close and reopen the UI, do not reload
Open Variant Manager UIR2026a+: Simulink.VariantManager.open(model) · Older: launchVariantManagerUI script
Close Variant Manager UIcloseVariantManagerUI script
Simulate a variant configurationreferences/variant-configuration-simulation.md
Run multiple configurations in parallelreferences/variant-configuration-simulation.md
Sweep configurations with parameter variationsreferences/variant-configuration-simulation.md
Compare simulation results across configurationsreferences/variant-configuration-simulation.md
Batch/cluster simulation of configurationsreferences/variant-configuration-simulation.md
Test variant configurations (Test Manager)references/variant-configuration-testing.md
Sweep configurations as test iterationsreferences/variant-configuration-testing.md
Regression/baseline testing across configurationsreferences/variant-configuration-testing.md
Generate test reports with variant traceabilityreferences/variant-configuration-testing.md

Key Functions

Many of these APIs are newer than the skill's release floor. Check the "Available From" column against the releaseVersion captured during onboarding before calling anything — see the Hard Rules. The reference files carry the authoritative per-function Introduced annotation; this table is the summary.

FunctionPurposeProductAvailable From
Simulink.VariantConfigurationData / Simulink.VariantConfigurationsThe VCS — container for configurations, control variables, constraintsSimulinkR2013b (renamed R2026b)
addConfiguration / removeConfiguration / addCopyOfConfigurationCreate, delete, copy a configurationSimulinkR2013b
addControlVariables / removeControlVariableSet or clear control variable values in a configurationSimulinkR2013b
addConstraint / removeConstraintDefine or drop a validity constraintSimulinkR2013b
getPreferredConfiguration / setPreferredConfigurationQuery or set the preferred configurationSimulinkR2022b
Simulink.VariantManager.applyConfigurationApply a configuration's values to the workspaceSimulinkR2022b
Simulink.VariantManager.activateModelActivate variant choices for a configurationSimulinkR2022b
Simulink.VariantManager.getConfigurationData / getVariantConfigurationsRetrieve the VCS attached to a modelSimulinkR2022b (renamed R2026b)
Simulink.VariantManager.findVariantControlVarsDiscover control variables used by a modelSimulinkR2016a
Simulink.VariantManager.generateConfigurationsGenerate all valid configurationsSimulinkR2022b
Simulink.VariantManager.reduceModelReduce a 150% model to selected designsSimulinkR2016a
getReferencedConfigurationName / addReferencedConfigurationAssociate referenced-model configurationsSimulinkR2022b–R2023b (renamed R2026b)
setVariantConfiguration / getVariantConfiguration (on SimulationInput)Non-intrusive simulation with a configurationSimulinkR2024a
variantConfigUpdateModel (script)Activation plus update diagram, with UI syncSimulinkR2024b
isConfigActive (in constraint conditions)Constrain one configuration against anotherSimulinkR2025a
Simulink.VariantManager.validateConstraintValidate a constraint against the modelSimulinkR2025a
Simulink.VariantManager.openOpen the Variant Manager UI programmaticallySimulinkR2026a
Simulink.VariantManager.analyzeModelAnalyze and compare configurationsSimulinkR2026a
Name=Value syntax on VCS methodsNamed arguments instead of positionalSimulinkR2026a
parsim / batchsimRun configurations in parallel or on a clusterSimulink + Parallel Computing ToolboxR2017a / R2018b
sltest.testmanager.*Test configurations via Test ManagerSimulink TestR2015a

On releases below an entry's "Available From", use the fallback documented in the corresponding reference file — do not call the API and do not invent a substitute.


Scripts

Calling Convention

Before calling any script, capture the current working directory in a separate call. Then pass it as the currentPath argument: project_path moves the working folder to the scripts folder, and each script changes back into currentPath before it runs and stays there.

% Call 1: capture current path (no project_path)
mcp__matlab__evaluate_matlab_code(code: "currentPath = pwd;")

% Call 2: invoke script (with project_path)
mcp__matlab__evaluate_matlab_code(
  code: "<scriptCall>(modelName, currentPath, ...)",
  project_path: "SKILL_DIR/scripts"
)

Available Scripts

ScriptPurposeSyntax
variantConfigActivateModelLightweight variant activation with UI syncvariantConfigActivateModel(modelName, currentPath, 'Configuration', configName)
variantConfigUpdateModelFull update diagram (compile) with UI sync (R2024b+)variantConfigUpdateModel(modelName, currentPath, 'Configuration', configName)
reloadVariantConfigurationsInUIReload VCS in an open Variant Manager UI after modificationsreloadVariantConfigurationsInUI(modelName, currentPath)
vmgrHighlightControlVariablesShow/hide control variable usage highlighting in the modelvmgrHighlightControlVariables(modelName, currentPath, controlVarNames, showUsage)
launchVariantManagerUIOpen Variant Manager UI for releases older than R2026alaunchVariantManagerUI(modelName, currentPath)
closeVariantManagerUIClose Variant Manager UI, handling unsaved changescloseVariantManagerUI(modelName, currentPath, applyChanges)

Switching the Attached VCS: Close and Reopen, Never Reload

reloadVariantConfigurationsInUI re-reads the object currently attached to the model. It cannot pick up a different object. When the attachment itself changes — you set the model parameter, or the user attaches another VCS themselves — an open Variant Manager UI keeps showing the old object and no amount of reloading will correct it.

Procedure:

  1. Ask whether to apply the edits pending in the UI to <oldVcsName> or discard them — closing the Variant Manager loses them otherwise. Recommend applying them if they look intentional.
  2. Close with the answer: closeVariantManagerUI(modelName, currentPath, applyChanges)
  3. Attach the new object, using the release-specific parameter name found during Onboarding:
    set_param(modelName, vcsModelParam, 'newVcsName');
    
  4. Reopen the UI — R2026a+: Simulink.VariantManager.open(modelName) · older: launchVariantManagerUI
  5. Re-run Onboarding. The configurations, control variables, and VCS location all changed.

Do not change the attachment while the UI is open — the UI and the model parameter disagree until it is reopened. Attaching is a model parameter change, so it dirties the model: tell the user to save the model, or the old attachment returns on reload.


Copyright 2026 The MathWorks, Inc.


FAQ

What does the simulink-manage-variant-configuration skill do?

Manage Simulink Variant Manager and Variant Configurations workflows — examine, list, and explore variant configurations, variant control variables, and variant model structure; create, modify, and delete variant configurations; validate variant constraints; generate valid variant configurations; apply, activate, or update models with variant configurations; compare variant configurations and analyze which blocks are active or different; open or close the Variant Manager UI; set up non-intrusive variant configuration specific simulation and testing with variant configurations; show/hide variant control variable usage. Use when working with variant configurations, variant manager, VCS objects (VariantConfigurationData / VariantConfigurations), variant control variables, preferred configuration, activation of variant choices, or reducing a variant model to selected variant configurations.

How do I install simulink-manage-variant-configuration?

Run npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill simulink-manage-variant-configuration in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/simulink-manage-variant-configuration/ (personal) or .claude/skills/simulink-manage-variant-configuration/ (project).

Which AI agents can use simulink-manage-variant-configuration?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is simulink-manage-variant-configuration safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains simulink-manage-variant-configuration?

It is published by matlab in matlab/simulink-agentic-toolkit. It has 0 recorded installs.

More from matlab/simulink-agentic-toolkit

View all →
matlab avatar

building-simulink-models

matlab/simulink-agentic-toolkit

Builds and edits Simulink, System Composer, Stateflow, and Simscape models. Use when modifying model structure, parameters, ports, connections, or Stateflow chart internals.

AI & Agents187 installs
matlab avatar

simulating-simulink-models

matlab/simulink-agentic-toolkit

Configures Simulink simulations non-destructively using SimulationInput objects — parameter overrides without modifying the model, batch sweeps via parsim, custom input signals via Dataset, and simulation data retrieval via logsout. Use when running sim()/parsim() with setVariable, setBlockParameter, setExternalInput, or when performing parameter sweeps and multi-run analysis. Not needed for one-shot simulations without configuration.

Data & Databases157 installs
matlab avatar

testing-simulink-models

matlab/simulink-agentic-toolkit

Tests Simulink models using either ephemeral Gherkin-based tests (modeltest) for quick validation or persistent tests (Simulink Test API) authored from requirements or behavioral specs. Requires Simulink Test.

Testing & QA125 installs
matlab avatar

specifying-plant-models

matlab/simulink-agentic-toolkit

Specify plant models for closed-loop simulation: system specs, architecture, build plans, validation plans. Use when creating, updating, or reviewing plant model specifications, planning plant model architecture, or planning plant model validation.

matlab avatar

specifying-mbd-algorithms

matlab/simulink-agentic-toolkit

Specify algorithms for Model-Based Design: system specs, architecture specs, implementation plans, test plans. Use when creating specifications for controllers, signal processing, diagnostics, estimators, or other algorithms authored in Simulink, Stateflow, System Composer, or MATLAB Function blocks.

AI & Agents91 installs
matlab avatar

generate-requirement-drafts

matlab/simulink-agentic-toolkit

Generates draft requirements from Simulink models. Use when drafting or updating requirement artifacts from a model. Prefers Requirements Toolbox (.slreqx) when available; falls back to structured YAML.

AI & Agents81 installs

Popular frontend & design skills

View category →
mattpocock avatar

setup-matt-pocock-skills

mattpocock/skills

Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.

Frontend & Design1.2M installs
anthropics avatar

frontend-design

anthropics/skills

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

OfficialFrontend & Design1.2M installs
mattpocock avatar

prototype

mattpocock/skills

Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.

Frontend & Design1.1M installs
uizze.sh avatar

ui-taste

uizze.sh

Give your coding agent better UI taste. Build and polish web and iOS interfaces with Uizze's anti-ui-slop playbooks and optional real-product references. Use for UI design, implementation, redesign, critique, or a final visual review in Claude Code, Codex, Cursor, or Copilot.

Frontend & Design1.1M installs
heygen-com avatar

hyperframes-animation

heygen-com/hyperframes

All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.

heygen-com avatar

hyperframes-core

heygen-com/hyperframes

The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.

Frontend & Design931.3K installs