本文へ移動
cccskills
無料GitHub で公開日本語紹介

simulink-manage-variant-configuration

Simulinkのバリアント構成や制御変数を調べ、構成の作成・検証・適用・比較から、構成別のシミュレーションやテスト設定まで進めるスキルです。

原文原文の説明を見る

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.

matlab/simulink-agentic-toolkitスター 1,289(GitHub 1,289 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 構成や制御変数を調べたいとき
  • 有効なバリアント構成を作りたいとき
  • 構成ごとの有効ブロックを比較したいとき
  • 構成別のシミュレーションやテストを準備したいとき

日本語での紹介

できること

Simulinkモデルに紐づくバリアント構成や制御変数、モデル内のバリアント構造を調べます。構成の追加・変更・削除、制約の検証、有効な構成の生成、モデルへの適用・有効化・更新にも対応します。複数の構成を比べて有効なブロックや差分を分析したり、選んだ設計にモデルを絞り込んだりできます。構成ごとのシミュレーションやテストの設定、Variant Manager UIの表示切り替え、制御変数の使用箇所の表示にも扱います。

こんなときに便利

構成の種類や制御変数を把握したいとき、制約に合う構成を作りたいとき、設計ごとの有効ブロックを比較したいときに向いています。特定の構成を適用したモデルでシミュレーションやテストを行う準備にも使えます。

使い方の例

  • 「このモデルに登録されたバリアント構成と制御変数を確認して」
  • 「制約を満たす構成を生成して、選んだ構成をモデルに適用して」
  • 「2つの構成で有効になるブロックの違いを調べて」

注意点

MATLABとSimulinkが必要です。機能やAPIにはMATLABリリースによる利用条件があり、原文では一部の新しい機能はR2026a以降などに限定されています。テストにはSimulink Test、並列・クラスタシミュレーションにはParallel Computing Toolboxが必要な場合があります。ライセンスはMathWorksのライセンスに従います。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(15)

  • SKILL.md22.7 KB
  • manifest.yaml526 B
  • references/variant-configuration-analysis.md6.1 KB
  • references/variant-configuration-simulation.md12.1 KB
  • references/variant-configuration-testing.md11.9 KB
  • references/variant-configurations-data-model.md13.2 KB
  • references/variant-configurations-operations.md19.0 KB
  • references/variant-manager-operations.md12.9 KB
  • scripts/closeVariantManagerUI.p4.4 KB
  • scripts/launchVariantManagerUI.p1.8 KB
  • scripts/reloadVariantConfigurationsInUI.p5.3 KB
  • scripts/variantConfigActivateModel.p6.9 KB
  • scripts/variantConfigUpdateModel.p6.4 KB
  • scripts/vmgrHelpers.p8.3 KB
  • scripts/vmgrHighlightControlVariables.p4.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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.


レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

arranging-simulink-layouts

無料概要あり

Simulinkのブロック図で重なったブロックや交差する線を整理し、必要な範囲の配置を整えたり、ブロックをサブシステムにまとめたりするスキルです。

  • 重なったブロックを整理したいとき
  • 線の交差を解消したいとき
  • 追加したブロックを並べ直したいとき
matlab/simulink-agentic-toolkit1,2892026年10月30日 更新

author-modeladvisor-checks

無料概要あり

SimulinkやSystem Composerのモデリング規約をガイドライン化し、Model Advisorチェックの仕様作成、実装、テストまで一貫して支援します。

  • モデリング規約をチェックにしたいとき
  • 独自のModel Advisorチェックを作りたいとき
  • 既存チェックをDetailStyleへ移行したいとき
matlab/simulink-agentic-toolkit1,2892026年10月30日 更新

authoring-simulink-inputs

無料概要あり

Simulinkモデルの入力ポート向けに、正弦波やランプなどの新しい信号を作り、型や補間方式を保ったDatasetとして整えます。

  • 入力ポート用の波形を作りたいとき
  • 空のDatasetにテスト信号を入れたいとき
  • Signal Editor用のシナリオを作りたいとき
matlab/simulink-agentic-toolkit1,2892026年10月30日 更新

System Composerで機能・論理・物理のシステム構成を設計し、インターフェースや割り当て、要件との対応をモデル上で管理します。

  • システムの機能・論理・物理構成を設計
  • インターフェース辞書をモデルに設定
  • 層をまたぐ要素の割り当てを管理
matlab/simulink-agentic-toolkit1,2892026年10月30日 更新

building-simulink-models

無料概要あり

Simulink、System Composer、Stateflow、Simscape のモデル構造やブロック、接続、設定を編集し、変更後の構成や接続状態を確認するスキルです。

  • モデルにブロックを追加・接続したいとき
  • Stateflow の状態や遷移を編集したいとき
  • System Composer の構成を作りたいとき
matlab/simulink-agentic-toolkit1,2892026年10月30日 更新

checking-model-compliance

無料概要あり

SimulinkモデルをMISRAやJMAABなどの規格に照らして検査し、優先度付きの指摘と修正案をまとめられます。

  • MISRAなどの規格でモデルを検査したいとき
  • JMAABのチェック結果を確認したいとき
  • 指摘事項と修正案のレポートを作りたいとき
matlab/simulink-agentic-toolkit1,2892026年10月30日 更新

matlab のスキルをすべて見る

このスキルの問題を報告する