0% found this document useful (0 votes)
21 views

Ex1: TF : Num (1 2) What We Right in Matlap

The document contains 4 examples demonstrating how to convert transfer functions (TF) to state-space (SS) models and vice versa in MATLAB. Each example shows converting a TF to an SS model using tf2ss, or converting an SS model to a TF using ss2tf. Key inputs and outputs are displayed, such as the numerator and denominator coefficients for the TF, and the A, B, C, and D matrices for the SS model.

Uploaded by

Hassan Yousri
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Ex1: TF : Num (1 2) What We Right in Matlap

The document contains 4 examples demonstrating how to convert transfer functions (TF) to state-space (SS) models and vice versa in MATLAB. Each example shows converting a TF to an SS model using tf2ss, or converting an SS model to a TF using ss2tf. Key inputs and outputs are displayed, such as the numerator and denominator coefficients for the TF, and the A, B, C, and D matrices for the SS model.

Uploaded by

Hassan Yousri
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Ex1: TF =

+
^++

>> num=[1 2]
What we right in matlap
The matlap output

num =
1

>> den=[1 2 3]
den =
1

>> [A,B,C,D]=tf2ss(num,den)
A=
-2
1

-3
0

B=
1
0

C=
1

D=
0

Ex2: TF =

^+
^++

>> num=[1 0 2]
num =
1

>> den=[1 0 3 5]
den =
1

>> [A,B,C,D]=tf2ss(num,den)
A=
0
1
0

-3
0
1

-5
0
0

B=
1
0
0

C=
1

D=
0

Ex3:

>> A=[0 1;-25 -4]

A=
0 1
-25 -4
>> B=[1;0]
B=
1
0
>> C=[1 0]
C=
1

>> D=0
D=
0

>> [num,den]=ss2tf(A,B,C,D)
num =
0

1.0000

4.0000

den =
1.0000

4.0000 25.0000

Ex 4: >> A=[0 1;-25 -4]


A=
0 1
-25 -4
>> B=[1 1;0 1]
B=
1 1
0 1
>> C=[1 0;0 1]
C=
1 0
0 1
>> D=[0 0;0 0]
D=
0
0

0
0

>> [num,den]=ss2tf(A,B,C,D,1)
num =
0
0
den =
1.0000

1.0000 4.0000
0 -25.0000
4.0000 25.0000

>> [num,den]=ss2tf(A,B,C,D,2)
num =
0
0
den =
1.0000

1.0000 5.0000
1.0000 -25.0000

4.0000 25.0000

You might also like