h2ox.m

来自「A Matlab toolbox for exact linear time-i」· M 代码 · 共 43 行

M
43
字号
% H2OX - From an impulse response to an extended %        observability matrix and a state sequence.%% [O,X] = h2ox(h,lmax,n,tol)%% H - first T>2*LMAX samples of the impulse response%     for MIMO (M-inputs, P-outputs) system, H is PxMxT%     for SISO system, H can be Tx1 vector% LMAX - upper bound on the system lag% N    - optional order of the system% TOL  - tolerance for order selection, default 1e-7%   If TOL < 0, the SVs are plotted and an input is asked.% O - extended observability matrix% X - state sequencefunction [O,X] = h2ox(h,lmax,n,tol)% Remove H(0) from Hif length(size(h)) == 2  h = h(2:end,:);else  h = h(:,:,2:end);end% SVD of the Hankel matrix of Markov parameters[U,S,V] = svd(blkhank(h,lmax+1),0);s = diag(S);% If not given, determine the orderif (nargin < 4 | isempty(tol))  tol = [];endif (nargin < 3 | isempty(n))  n = order(s,tol);end% Rank revealing factorizationsqrt_s = sqrt(1./s(1:n))';O = sqrt_s(ones(size(U,1),1),:) .* U(:,1:n);if nargout > 1  X = (sqrt_s(ones(size(V,1),1),:) .* V(:,1:n))';end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?