Signals and Systems
ECE/EEE/INSTR F 243
MATLAB Lecture 01
BITS Pilani Introduction
K K Birla Goa Campus Nitin Sharma
Getting Started
• What is MATLAB?
• MATLAB is produced by MathWorks, and is one of a
number of commercially available software packages for
numerical computing and programming. MATLAB
provides an interactive environment for algorithm
development, data visualization, data analysis, and
numerical computation.
• MATLAB derives its name from MATrix LABoratory.
BITS Pilani, K K Birla Goa Campus
The MATLAB Environment
BITS Pilani, K K Birla Goa Campus
Basic Calculations
BITS Pilani, K K Birla Goa Campus
Basic Math Functions
• abs(x) absolute value
• exp(x) exponential
• sin(x),cos(x) sine, cosine
• log(x),log10(x) natural logarithm, common logarithm
• sqrt(x) square root
• sign(x) signum
• round(x),fix(x) round towards nearest integer, round towards
zero
• floor(x),ceil(x) round towards negative infinity, round towards
plus infinity
• size(x),length(x) size of array, length of vector
BITS Pilani, K K Birla Goa Campus
Variables and Arrays
BITS Pilani, K K Birla Goa Campus
MATLAB Symbols
BITS Pilani, K K Birla Goa Campus
Basic Examples
BITS Pilani, K K Birla Goa Campus
Matrix Operation
BITS Pilani, K K Birla Goa Campus
Matrix Operation
BITS Pilani, K K Birla Goa Campus
Files
The script can be run by either typing its name
at the command prompt, or clicking the Save
and run icon
BITS Pilani, K K Birla Goa Campus
Example of M-file
BITS Pilani, K K Birla Goa Campus
Compare a script and a
function
BITS Pilani, K K Birla Goa Campus
Plotting
BITS Pilani, K K Birla Goa Campus
How to use subplot
BITS Pilani, K K Birla Goa Campus
How to use Stem
BITS Pilani, K K Birla Goa Campus
Miscellaneous commands
BITS Pilani, K K Birla Goa Campus
Some plotting commands
BITS Pilani, K K Birla Goa Campus
Loops
BITS Pilani, K K Birla Goa Campus
Linear Algebra
BITS Pilani, K K Birla Goa Campus
BITS Pilani
K K Birla Goa Campus
Thank You!