📄 simom2.m
字号:
function [sys, x0] = simom2(t,x,u,flag,a,b,c,d)
% SIMOM2 State-space equation example(2) as an S-function M-file.
% Represents the state-space equations:
%
% dx/dt = A.x + B.u
% y = C.x + D.u
%
% as an M-file where the matrices, A,B,C,D are provided
% externally.
% Where x is the state vector, u is vector of inputs,
% and y is the vector of outputs.
%
% See also: SIMOM,User's manual under Advanced Topics Section.
% Copyright (c) 1990-94 by The MathWorks, Inc.
if abs(flag) == 1
sys = a*x + b*u;
elseif flag == 3
sys = c*x + d*u;
elseif flag == 0
sys = [length(a) 0 size(d), 0, 1];
x0 = ones(3,1);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -