Control System Lab Using MATLAB: (ELE 302L)
Control System Lab Using MATLAB: (ELE 302L)
(ELE 302L)
Hemant Kumar
Assistant Professor,Department of Electronics
Banasthali Vidyapith, Banasthali, Rajasthan
1
Approach
• Lab1- Basics of MATLAB
• Lab2- Signal and System
• Lab3- Signal and System//Learning by doing
• Lab4- Control System [Transfer Function]
• Lab5- Control System [Polynomial, Partial fraction]
• Lab6- Control System [Time Response of System]
• Lab7- Control system [Root Locus, Nyquist Plot]
• Lab8- Control System [Bode plot and study related
experiments]
• Lab9- Revision/Continuous Assessment of Lab
2
Banasthali Vidyapith Rajasthan
Assessment Evaluation Policy
Max. Marks: 100 (CA: 40 + ESA: 60)
Subtraction – 6–3=3
Multiplication * 6 * 3 = 18
Right division / 6/3=2
Left division \ 6\3=3/6=1/2
Exponentiation ^ 6 ^ 3 = 6*6*6=216
8
9
Banasthali Vidyapith Rajasthan
Banasthali Vidyapith Rajasthan 10
Predefined Variables
11
General Command
Help
Workspace
information
Directory information
12
Banasthali Vidyapith Rajasthan 13
Arrays
• One-dimensional array-
Row Vector x = [7 – 1 2 – 5 8]
Column Vector x = [7 ; – 1 ; 2 ; – 5 ; 8]
• Two-dimensional array – Matrix
>>A = [1 3 – 4 ; 0 – 2 8]
>>B = [1 2 3 4; 5 6 7 8]
• Addressing Arrays – colon (:) can be used to address a range of
elements in a vector or a matrix
Colon for a vector
Va(:) – refers to all the elements of the vector Va
Va(m : n) – refers to elements m through n of the vector Va.
>>V = [2 5 -1 11 8 4 7 -3 11];
>>u = V(2 : 8);
u = 5 -1 11 8 4 7 -3
Banasthali Vidyapith Rajasthan 14
•Colon for a matrix
C = (A. /B). ^2
C=
2.2500 81.0000 1.0000
19
Banasthali Vidyapith Rajasthan
Polynomial
•conv(a, b)
•[q, r] = deconv(n, d)
•roots(a)
•poly(r)
•polyval (a, x)
20
UTILITY MATRICES
A & B = 01001
A | B = 11101
~A = 10010 Banasthali Vidyapith Rajasthan
xor(A,B) = 10100 21
•Magic(n) {n x n matrix whose row/column/ diagonal sum same}
1 2 3
•a=[1 2 3; 4 5 6; 7 8 9]; 4 5 6
sum(a) {12 15 18} 7 8 9
Y=fliplr(a) {3 2 1 z= flipud(a) 7 8 9
6 5 4 4 5 6
9 8 7 1 2 3
Diag (a) 1 diag(Y) 3
5 5
9 7
plot(z)
plot(z, 'r')