Lab # 1: AN OVERVIEW OF MATLAB
SSUET/QR/114
LAB # 1
AN OVERVIEW OF MATLAB
Objective
An Introduction to MATLAB.
Theory
1 MATLAB ENVIORNMENT
Matlab stand for Matrix laboratory.
Matlab was originally written to provide easy access to matrix software.
Matlab is a high performance language for
Technical computing integrator computations.
Visualization and programming.
Easy to use environment where problem and solution are expressed in
mathematical rotation.
Matlab usage
In Universities.
In Industry.
Matlab features a family of add-on application specific solution called
tool box.
Tool boxes are comprehensive collection of matlab (M-files) that extends
the matlab environment to solve particular classes of problems.
Add on tool boxes for
Signal processing
Control system
Neural networks
2 MATLAB SYSTEM
It includes.
1
DESKTOP TOOLS AND DEVELOPMENT ENVIRONMENT:
It includes.
Matlab desktop and command wind.
An editor and debugger.
CE-302:Signals and Systems
Lab # 1: AN OVERVIEW OF MATLAB
SSUET/QR/114
A code analyzer.
Browsers for viewing help.
The work space files and folder.
2
MATHEMATICAL FUNCTION LIBRARY
Collection of computational algorithm ranging from elementary functions
like sum , sine , cosine and others.
More Sophisticated functions like,
Matrix.
Inverse Matrix.
Z and Z transform.
Fourier transforms.
DTFT, IDTFT, FFT, DFT, etc.
3
THE LANGUAGE
Matlab language is a high level matrix/array language with control
flow statements function, data structure and object oriented
programming language.
GRAPHICS
Matlab has an extensive facility for displaying vector and matrices as
graph.
It include high level functions for two dimensional and three
dimensional data visualization, image processing animation and
presentation graphics.
EXTERNAL INTERFACE
The external interface library allows you to write C and FORTRAN
program that interact with matlab.
DOCUMENTATION
See matlab help manual
3. Explain the main windows in matlab desktop?
CE-302:Signals and Systems
Lab # 1: AN OVERVIEW OF MATLAB
CE-302:Signals and Systems
SSUET/QR/114
4.Command Window
This window is used to enter variables and run functions and Mfiles.
For more information, click the Help button.
5.Command History
In this window, we can view previously used functions, and copy and
execute selected lines.
Help browser
The Help browser is used to search and view documentation for all your
Math Works products.
To open the Help browser, click the help button in the toolbar, or Type
helpbrowser in the Command Window.
6. MATLAB Workspace
The MATLAB workspace consists of the set of variables built up during a
MATLAB session and stored in memory.
7.Current Directory Browser
MATLAB file operations use the current directory and the search path as
reference points.
Any file you want to run must either be in the current directory or on the
search path.
3 BASIC OPERATION
OPERATORS
SYMBOLS
EXAMPLE
Addition
3+2
Subtraction
2.4-16.5
Multiplication
3.14*6
Division
Exponentiation
\ or /
15.4/7 or 7\19.4
2^8
8.SPECIAL VARIABLE WITH DESCRIPTION
Ans
Pi
Eps
Inf
Nan or nan
I or j
Nargin
Nargout
Real min
Real max
Default variable name used for result.
Ration of the circumference of the circle.
smallest number that, when added to 1 creates a number.
infinity (eg 1/0).
stands for not a number (eg 0/0).
stands for -1
No. of function input argument
No. of function output argument
smallest usable positive real no.
largest usable positive real no.
CLASS ACTIVITY
Objectives
4+12+144-36-10*18/12 ?
10*14+18-188*14/24 ?
2^10 ?
4
S. NO.
ITEM
QUANTITY
UNIT COST
1.
Pen
40
10
2.
Stapler
20
40
3.
Eraser
45
4.
Paper rim
350
5.
Pencil
100
i
ii
Find the total cost of all the items.
Also find the average of the total cost.
HOME TASK
Objective
Create a mark sheet of three subjects
Program
display('MARK SHEET OF THREE SUBJECTS')
display('Enter your subject marks')
CS = input('Enter 1st subject marks out of 100 :: ')
RDBMS = input('Enter 2nd subject marks out of 100 :: ')
BAC = input('Enter 3rd subject marks out of 100 :: ')
TotalMarks = CS + RDBMS + BAC
Total = TotalMarks/300;
Percentage = Total * 10