- 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 就會安裝它。