📄 obmat.m
字号:
function y = obmat(A,C,i)%OBMAT Constructs the observability matrix with a given index.%% OBMAT(A,C,k) constructs the truncated (k < n), standard (k = n) or% extended (k > n) observability matrix of the state-space system% (A,B,C,D) with n states and p outputs.%% Usage:% Y = obmat(A,C,k)%% Inputs: % A := Square matrix with n rows and n columns.% C := Matrix with p rows and n columns.% k := Positive integer.% % Outputs: % Y := Observability matrix with k*p rows and n columns, defined as%% [ C ]% [ C*A ]% Y := O_k := [ C*A^2 ]% [ : ]% [ C*A^(k-1) ]%% See also OBSV.%% CUED System Identification Toolbox.% Cambridge University Engineering Department.% Copyright (C) 1998-2002. All Rights Reserved.% Version 1.00, Date: 01/06/2002% Created by H. Chen and E.C. Kerrigan. [rowA,colA] = size(A);[rowC,colC] = size(C);if rowA ~= colA, error('A is not a square matrix.')endif colC ~= colA, error('The column numbers of two input matrices are not equal.')endif (i < 1) | (i ~= fix(i)), error('k is not a positive integer.')endp = rowC;n = rowA;if i == 1, y = C;else y = zeros(i*p,n); d = C; for j = 1:i, y((j-1)*p+1:j*p,:) = d; d = d*A; endend % *** last line of obmat.m ***
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -