You are on page 1of 2

Linear Control Systems LAB 1

Introduction ToMatlab
Objective:
To introduce the basics of Matlab to students, which includes:
Getting Started
Main GUI
Main & Sub Tabs
Major Sections
Various Task Types

Theory:
The name MATLAB stands for MatrixLaboratory. MATLAB was written originallyto
provide easy access to matrix software developed by the LINPACK (linear system
package) and EISPACK (Eigen system package) projects.
MATLAB is a high-performance language for technical computing. It integrates
computation, visualization, and programming environment. Furthermore, MATLAB
is a modern programming language environment: it has sophisticated data structures,
contains built-in editing and debugging tools, and supports object-oriented
programming. These factors make MATLAB an excellent tool for teaching and
research.
MATLAB has many advantages compared to conventional computer languages (e.g.,
C, FORTRAN) for solving technical problems. MATLAB is an interactive system
whose basic data element is an array that does not require dimensioning. The software
package has been commercially available since 1984 and is now considered as a
standard tool at most universities and industries worldwide.
It has powerful built-in routines that enable a very wide variety of computations. It
also has easy to use graphics commands that make the visualization of results
immediately available. Specific applications are collected in packages referred to as
toolbox. There are toolboxes for signal processing, symbolic computation, control
theory, simulation, optimization, and several other fields of applied science and
engineering.
Functions:
clc, elf, clear, who,whos, disp, input, fprintf, conv, polyval, roots, printsys, tf,
Series, feedback.
Statement, variable and function:
When assignment operators used to assign some expression to a variable, it is
called statement.
Terms to be defined (Case sensitivity, Mathematical operators, NaN,who,whos)
Polynomial entry (P(s)= s2 + 3s + 4, p(s) = 3s2 + 2s + 1)

Engr. M.E.Q |Engr. Ateeq Ur Rehman

Page 1

Linear Control Systems LAB 1


Polynomial functions ( conv(p, q), polyval(p, number), roots(p) )
Transfer function printsys(num, den), series(num1, den1, num2, den2)
cloop(num, den, -1), feedback(numg, deng, numh, denh, -1)
Pole-zero map
pzmap(num, den)

Example:
% Compute Average Temperature
% Plot the temperature data
time=[0.0, 0. 5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4. 0, 4.5,
5.0]; %time=[0:0.5:5];
temps =[105, 126, 119, 129, 132, 128, 131, 135, 136, 132,
137]; average=mean(temps)
plot(time, temps),
title('Temeparature Measurement'),
xlabel('Time,minutes'),
ylabel('Temperature, degrees F), grid

Practice Problem:
Generate a table with conversion from Celsius to Fahrenheit. Allow the user to
enter the starting temperature, the increment between lines, and the number of
lines for the table.

Engr. M.E.Q |Engr. Ateeq Ur Rehman

Page 2

You might also like