blob: 4ae1383d8b23a69cf085e05321069d8c1fb1b54f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
//caption:state_transition_matrix
//example 11_36
//page 511
s=%s;
syms t
A=[1 4;-2 -5]
[r c]=size(A);//size of matrix A
p=s*eye(r,c)-A;//s*I-A where I is identity matrix
q=det(p)//determinant of sI-A
r=inv(p)//inverse of sI-A
//for calculating state transistion matrix
ip=[0 0;0 0]
i=1;j=1;
for i=1:2
for j=1:2
ip(i,j)=ilaplace(r(i,j),s,t);
j=j+1;
end
i=i+1;
end
disp(ip,"state transistion matrix,ip(t)=");
|