- name
SKILL.md
技能文件保留在发布者的仓库中。
在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add matlab/simulink-agentic-toolkit --skill simulink-linearize -a cursor -y在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add matlab/simulink-agentic-toolkit --skill simulink-linearize -a claude-code -y在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add matlab/simulink-agentic-toolkit --skill simulink-linearize -a codex -y在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add matlab/simulink-agentic-toolkit --skill simulink-linearize -a grok -y在 Grok Bot 聊天中发送复制的消息。Bot 会从 GitHub 获取这个 SKILL.md,并添加到你所有 Bot 共享的技能中。
Install this skill: https://github.com/matlab/simulink-agentic-toolkit/tree/HEAD/skills-catalog/control-systems/simulink-linearize来自发布者
Extract linear time invariant (LTI) or linear parameter varying (LPV) models from Simulink using linearize and related APIs from Simulink Control Design.
ssInterpolantsimulink-frequency-response for frestimate-based fallbackThe linearization pipeline has four stages. Not every task requires all stages.
1. Define I/O Points 2. Operating Point → 3. Linearize → 4. Debug
(root level/linio) (findop/operspec) (linearize) (advisor)
Determine I/O points using this decision sequence. Use the first case that applies:
Case A — IO points can be inferred from prompt or model context:
Use the first sub-case that matches:
User specifies explicit I/O signals or blocks (e.g., "from r to y") → define linio points. All linio points must reference a block's output port. If a candidate block has no output ports (Outport, Terminator, Scope) → trace upstream to find the source block and port with model_read.
io = [linio(sprintf("%s/InputBlock", mdl), 1, "input"); ...
linio(sprintf("%s/OutputBlock", mdl), 1, "output")];
User targets a specific block or subsystem (e.g., "linearize the Controller") → Use the block path as the io argument signaling linearize to perform open-loop linearization of the block
io = sprintf("%s/Controller", mdl);
Model has existing linearization points → io = getlinio(mdl); — use if non-empty.
Root-level Inport/Outport blocks exist → omit linio. The linearize command will linearize about the model's root-level I/Os. Use model_read at root scope (depth "0") to confirm root-level Inport/Outport blocks exist.
Case B — Cannot determine IO points:
If none of the above apply → do not guess. Ask the user which signals to use as linearization inputs and outputs. Present the available blocks/signals from the model to help them decide.
Block path rules:
sprintf for block names containing special characters (newlines, commas):
blkPath = sprintf("%s/Integrator,\nSecond-Order", mdl);
io = linio(blkPath, 1, "output");
sub.Name = sprintf("%s/My\nBlock",mdl);
sub.Value = replacement_lti;
sys = linearize(mdl, io, sub);
Determine where to linearize. Choose one:
For batch workflows, use copy to create the operating point array:
% assign varied variable to workspace
myvar = 0;
% create base spec
opBase = operspec(mdl);
opBase.States(1).Known = true;
% define param to vary
nPts = 5;
params.Name = "myvar";
params.Value = linspace(-pi, pi, nPts);
for i = nPts:-1:1
opArray(i) = copy(opBase);
opArray(i).States(1).x = params.Value(i);
end
ops = findop(mdl, opArray, params, findopOptions());
sys = linearize(mdl, OPTIONAL_ARGS);
Each input argument to linearize is optional (beside mdl).
sys = linearize(mdl, io, op, params, blocksub, opts);
Multi-rate models default to the LCM sample time. Use the SampleTime option to specify linear model sample time:
opts = linearizeOptions(SampleTime=0);
sys = linearize(mdl, io, opts);
Batch linearization for LPV:
opts = linearizeOptions(BatchConsistency="on", StoreOffsets="system");
sysArray = linearize(mdl, io, ops, params, opts);
lpvSys = ssInterpolant(sysArray);
When StoreOffsets="system", offsets are embedded in each model of the array. Call ssInterpolant(sysArray) with no offset argument.
Define SamplingGrid if one is not generated from linearize (params argument is omitted).
Multiple transfer functions (single compile) with slLinearizer:
sllin = slLinearizer(mdl);
addPoint(sllin, ["r", "y", "e", "u"]);
T = getIOTransfer(sllin, "r", "y");
S = getSensitivity(sllin, "e");
L = getLoopTransfer(sllin, "u", sign);
Use when linearization returns zero gain or unexpected results.
opts = linearizeOptions(StoreAdvisor=true);
[sys, ~, info] = linearize(mdl, io, opts);
advisorResult = advise(info.Advisor);
Always capture the output of advise — calling without an output argument launches the UI.
Inspect problematic blocks:
problematic = find(advisorResult, linqueryHasDiagnostics());
for i = 1:numel(problematic.BlockDiagnostics)
diag = problematic.BlockDiagnostics(i);
fprintf('%s: %s\n', diag.BlockPath, join(string(diag.DiagnosticMessages), newline));
end
Common advisor findings and resolutions:
tfSys = tf(sys); % Transfer function
zpkSys = zpk(sys); % Zero-pole-gain
For LPV models, simulate and compare against Simulink:
[y, t] = lsim(lpvSys, u, tVec, x0, paramTrajectory);
advise() to prevent UI launchcopy(opSpec) for batch operating point arrays, not assignmentBatchConsistency="on" for batch linearization destined for LPVStoreOffsets="system" when building LPV models with ssInterpolantslLinearizer when extracting multiple transfer functions from one modellinio on blocks without output ports (Outport, Terminator, Scope) — trace upstream to find the source blocklinmod, linmod2, linmodv5 or dlinmod — these are legacyCopyright 2026 The MathWorks, Inc.
>
---name: simulink-linearizedescription: >---# skills-catalog/control-systems/simulink-linearize/SKILL.md常见问题
从发布者处下载 skills-catalog/control-systems/simulink-linearize/SKILL.md,或复制路径后打开仓库。PlugMCP 只收录该技能,不托管文件。
发布者将它存放在 https://github.com/matlab/simulink-agentic-toolkit。
Claude、Cursor、Codex 和 Grok Build 可以读取你从发布者仓库添加的 SKILL.md。在聊天中发送技能的 GitHub 文件夹链接,Grok Bot 就会安装它。