simom2.m

来自「本书是电子通信类的本科、研究生辅助教材」· M 代码 · 共 25 行

M
25
字号
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 + =
减小字号Ctrl + -
显示快捷键?