フィルターのクリア

State Space in lsim keeps returning 'Matrix dimensions must agree'

2 ビュー (過去 30 日間)
Anthony Sirico
Anthony Sirico 2021 年 2 月 12 日
回答済み: Anthony Sirico 2021 年 2 月 12 日
A = [1 0 0 0; 0 -1 0 0; 0 0 -2 0; 0 0 0 -3];
B = [1 0; -1 1; 0 -1; 1 -1];
C = eye(4);
D = 0;
X0 = [-2; -1; 1; 2];
EvA = eig(A);
sys = ss(A,B,C,D);
AT = transpose(A)
BT = transpose(B)
t = linspace(0,3);
t0 = 0;
tfinal = 3;
Wc = integral(@(t) integrand(t,t0,A,B),t0,tfinal,'ArrayValued',true);
IW = inv(Wc)
phi = exp(AT.*(-t));
u = -BT*phi*IW*X0;
lsim(sys, u, t, X0)
grid on
Matrix dimensions must agree.
Error in HW3_1 (line 17)
phi = exp(AT.*(-t));
I know it has to do with t, so any recommendations?

採用された回答

Anthony Sirico
Anthony Sirico 2021 年 2 月 12 日
t has to be 1x4.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDigital Filter Analysis についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by