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

Assignemtn 1

This document contains Matlab code that defines state space matrices for a system and converts them to a transfer function. It then plots the step response and impulse response of the system using the transfer function. The code defines the A, B, C, and D matrices, converts them to the numerator and denominator polynomials a and b using ss2tf, defines the transfer function MyTF, and plots the step response on the first subplot and impulse response on the second subplot.
Copyright
© © All Rights Reserved
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)
9 views

Assignemtn 1

This document contains Matlab code that defines state space matrices for a system and converts them to a transfer function. It then plots the step response and impulse response of the system using the transfer function. The code defines the A, B, C, and D matrices, converts them to the numerator and denominator polynomials a and b using ss2tf, defines the transfer function MyTF, and plots the step response on the first subplot and impulse response on the second subplot.
Copyright
© © All Rights Reserved
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/ 5

Q1

Matlab Code
clear all
clc
close all
%State Space Matrices
A = [0 1 0 0;0 0 1 0;0 0 0 1;-680 -176 -86 -6]
B = [0;0;0;1]
C = [100 20 10 0]
D = [0]
[a,b] = ss2tf(A,B,C,D)
MyTF = tf (a,b)
subplot(211), step(MyTF)
subplot(212), impulse(MyTF)

output
A =
0
0
0
-680

1
0
0
-176

0
1
0
-86

0
0
1
-6

20

10

B =
0
0
0
1
C =
100
D =
0
a =
0

10.0000

20.0000

100.0000

b =
1.0000

6.0000

86.0000

176.0000

MyTF =
10 s^2 + 20 s + 100
---------------------------------s^4 + 6 s^3 + 86 s^2 + 176 s + 680
Continuous-time transfer function.
>>

680.0000

Q2

You might also like