Professional Documents
Culture Documents
A=
-9 -10
5
>> B=[1;1]
B=
1
1
>> C=[1 0]
C=
>> D=0
D=
>> eig(A)
ans =
-2.0000 + 1.0000i
-2.0000 - 1.0000i
a=
x1 x2
x1 -9 -10
x2
b=
u1
x1 1
x2 1
c=
x1 x2
y1 1 0
d=
u1
y1 0
Continuous-time model.
>> [a,b,c,d] = ssdata(sys)
a=
-9 -10
5
b=
1
1
c=
d=
num =
1 -15
>> den=[1 4 5]
den =
>> sys=tf(num;den)
??? sys=tf(num;den)
|
Error: Unbalanced or unexpected parenthesis or bracket.
>> sys=tf(num,den)
Transfer function:
s - 15
------------s^2 + 4 s + 5
>> [A,B,C,D]=tf2ss(num,den)
A=
-4
-5
B=
C=
1 -15
D=
STEP(SYS) plots the step response of the LTI model SYS (created
with either TF, ZPK, or SS). For multi-input models, independent
step commands are applied to each input channel. The time range
and number of points are chosen automatically.
Overloaded methods:
lti/step
idmodel/step
idfrd/step
iddata/step
idnlmodel/step
uss/step
>> step(A,B,C,D)
Warning: Using a default value of 0.2 for maximum step size. The simulation step
size will be equal to or
less than this value. You can disable this diagnostic by setting 'Automatic solver
parameter selection'
diagnostic to 'none' in the Diagnostics page of the configuration parameters
dialog.
>>
>> A= [-9 -10;5 5]
A=
-9 -10
5
>> B=[1;1]
B=
1
1
>> C=[1 0]
C=
>> D=0
D=
>> ctrb(A,B)
ans =
1 -19
1
10
>> obsv(A,C)
ans =
-9 -10
P=
25
>> p=root(P)
??? Undefined function or method 'root' for input arguments of type 'double'.
>> p=roots(P)
p=
-3.5000 + 3.5707i
-3.5000 - 3.5707i
>> K=place(A,B,p)
K=
0.7586
2.2414
Warning: Using a default value of 0.2 for maximum step size. The simulation step
size will be equal to or
less than this value. You can disable this diagnostic by setting 'Automatic solver
parameter selection'
diagnostic to 'none' in the Diagnostics page of the configuration parameters
dialog.
>>
>> A=[-2 1; 2 -3]
A=
-2
-3
>> B=[2;0]
B=
2
0
>> C=[2 1]
C=
>> D=0
D=
>> eig(A)
ans =
-1
-4
>> obs=obsv(A,C)
obs =
-2
-1
>> rank(obs)
ans =
>> x0=[1;0]
x0 =
1
0
>> step(A,B,C,D,x0)
??? Subscript indices must either be real positive integers or logicals.
>> ss=(A,B,C,D)
??? ss=(A,B,C,D)
|
Error: Expression or statement is incorrect--possibly unbalanced (, {, or [.
>> sys=ss=(A,B,C,D)
??? sys=ss=(A,B,C,D)
|
Error: The expression to the left of the equals sign is not a valid target for an
assignment.
>> sys=ss(A,B,C,D)
a=
x1 x2
x1 -2 1
x2 2 -3
b=
u1
x1 2
x2 0
c=
x1 x2
y1 2 1
d=
u1
y1 0
Continuous-time model.
>> X0=[1;0]
X0 =
1
0
>> initial(sys,x0)
>> com=ctrb(A,B)
com =
-4
>> rank(com)
ans =
>> inv(com)
ans =
0.5000
0
0.5000
0.2500
Q=
0.2500
>> T=[Q;Q*A]
T=
0.2500
0.5000 -0.7500
p=
-10 -20
>> K=place(A,B,p)
K=
12.5000 30.2500
>> A-B*K
ans =
-27.0000 -59.5000
2.0000 -3.0000
>> eig%
??? Error using ==> eig
Not enough input arguments.
>> z=A-B*K
z=
-27.0000 -59.5000
2.0000 -3.0000
>> eig(z)
ans =
-20.0000
-10.0000
>> C=[0;0]
C=
0
0
>> sys1=ss(z,B,C,D)
??? Error using ==> ss.ss at 208
The values of the "a" and "c" properties must be matrices with the same number
of columns.
>> C=[2 1]
C=
>> init=[0;0]
init =
0
0
>> sys1=ss(z,B,C,D)
a=
x1
x1
x2
-27 -59.5
x2
b=
u1
x1 2
x2 0
c=
x1 x2
-3
y1 2 1
d=
u1
y1 0
Continuous-time model.
>> intial(sys1;init)
??? intial(sys1;init)
|
Error: Unbalanced or unexpected parenthesis or bracket.
>> initial(syst1,init)
??? Undefined function or variable 'syst1'.
>> x1=[0;0]
x1 =
0
0
>> initial(sys1,x1)
>> [num,den]=tf2ss(z,B,C,D)
??? Error using ==> tf2ss
Too many input arguments.
>> [num,den]=ss2tf(z,B,C,D)
num =
4.0000 16.0000
den =
>> sys2=tf(num,den)
Transfer function:
4 s + 16
---------------s^2 + 30 s + 200
L=
30 200
>> roots(L)
ans =
-20
-10
>> step(z,B,C,D)
>> [num,den]=ss2tf(A,B,C,D)
num =
16
den =
>> syss3=tf(num,den)
Transfer function:
4 s + 16
------------s^2 + 5 s + 4
>> L=[1 5 4]
L=
>> roots(L)
ans =
-4
-1
>> step(sys3)
??? Undefined function or variable 'sys3'.
>> initial(sys3)
??? Undefined function or variable 'sys3'.