- name
SKILL.md
Tệp skill vẫn nằm trong kho mã của nhà phát hành.
Dán lệnh đã sao chép vào terminal. Lệnh sẽ cài đặt tệp SKILL.md này vào agent đó.
npx skills add matlab/simulink-agentic-toolkit --skill simulink-linearize -a cursor -yDán lệnh đã sao chép vào terminal. Lệnh sẽ cài đặt tệp SKILL.md này vào agent đó.
npx skills add matlab/simulink-agentic-toolkit --skill simulink-linearize -a claude-code -yDán lệnh đã sao chép vào terminal. Lệnh sẽ cài đặt tệp SKILL.md này vào agent đó.
npx skills add matlab/simulink-agentic-toolkit --skill simulink-linearize -a codex -yDán lệnh đã sao chép vào terminal. Lệnh sẽ cài đặt tệp SKILL.md này vào agent đó.
npx skills add matlab/simulink-agentic-toolkit --skill simulink-linearize -a grok -yGửi tin nhắn đã sao chép trong cuộc trò chuyện Grok Bot. Bot sẽ lấy tệp SKILL.md này từ GitHub và thêm vào bộ skill mà mọi Bot của bạn dùng chung.
Install this skill: https://github.com/matlab/simulink-agentic-toolkit/tree/HEAD/skills-catalog/control-systems/simulink-linearizeTừ nhà phát hành
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.mdCâu hỏi thường gặp
Tải skills-catalog/control-systems/simulink-linearize/SKILL.md từ nhà phát hành, hoặc sao chép đường dẫn và mở kho mã. PlugMCP chỉ liệt kê skill và không lưu trữ tệp này.
Nhà phát hành duy trì nó tại https://github.com/matlab/simulink-agentic-toolkit.
Claude, Cursor, Codex và Grok Build có thể đọc tệp SKILL.md mà bạn thêm từ kho mã của nhà phát hành. Grok Bot cài đặt skill khi bạn gửi liên kết thư mục GitHub của skill trong cuộc trò chuyện.