Error while executing the simulation?

6 ビュー (過去 30 日間)
Virendra Kowale
Virendra Kowale 2021 年 2 月 14 日
コメント済み: Star Strider 2021 年 2 月 14 日
clear all
close all
clc
s = -14.5
A = [-3, 5, -7, 0; 0.5, -1.5, 0.5, -7.5; -5, 0, -3, 0; -0.5, -5, 0, -7];
B = [1, 0; 0, -1; -2, 0; 0, 1];
C = [1, 0, 0, 0; 0, -1, 0, 0];
D = [-1, 0; 2, 0];
sys = ss(A,B,C,D);
M = (s*eye(4,4) - A);
P = [ M, -B; C, D]
k = rank(P)
uM = null(P,'r')
I = transpose(uM)
%sys2 = tf( sys );
t = linspace(0, 2.5, 10).';
x_zero = transpose([0,0,0,-0.1333])
u = x_zero.*exp(-14.5*t)
x0= initial(sys,x_zero)
[y,t] = lsim(sys ,u , t)
error that I am receiving:-
Matrix dimensions must agree.
Error in antiresonance_part_two (line 36)
u = x_zero.*-exp(-14.5*t)

採用された回答

Star Strider
Star Strider 2021 年 2 月 14 日
See my Answer to your duplicate Question how to simulate using lsim command I am receiving error because of variable 't'(time). It took a few minutes to find out what the problem was and then propose a solution.
  2 件のコメント
Virendra Kowale
Virendra Kowale 2021 年 2 月 14 日
sorry I forgot to remove this question. Thanks a ton. Once again
Star Strider
Star Strider 2021 年 2 月 14 日
Again, as always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by