Introduction To

MATLAB
S.S.R.K.M.GUPTA.M.Tech.,(M.Phil)
Assistant Professor

Unix. . Macintosh. It was later marketed and further developed under MathWorks Inc.Introduction MATLAB – Stands for MATrix LABoratory Initially developed by a lecturer Cleve Moler. It has excellent programming features and graphics capability – easy to learn and flexible.mathworks. at the University of New Mexico in 1970’s to help students learn linear algebra. (founded in 1984) – www.com Matlab is a software package which can be used to perform analysis and solve mathematical and engineering problems. DOS It has several tooboxes to solve specific problems. Available in many operating systems – Windows.

MATLAB Functionality Built-in Functionality includes  Matrix manipulation and linear algebra  Data analysis  Exploration and visualisation  Algorithm development  Modelling. and prototyping  Scientific and engineering graphics Add-on toolboxes provide  Image processing  Signal Processing  Optimization  Genetic Algorithms  …and hundreds of other functions  . simulation.

MATLAB consists of The MATLAB language The MATLAB working environment Handle Graphics The MATLAB function library. The MATLAB Application Program Interface (API) .

no compilation needed (but possible) MATLAB does not need any variable declarations. no storage allocation. functions etc.Some features of MATLAB     Everything in MATLAB is a matrix ! MATLAB is an interpreted language. . no dimension statements. with full access to all variables. no pointers Programs can be run step by step. has no packaging.

8 0.2:2.7 0.1 0 -3 -2 -1 0 1 2 3 x = -2.*x)).6 0. bar(x.4 0. 6 .5 0.9:0.9.3 0.What kind of graphics is possible in Matlab? 1 0.exp(-x.9 0.2 0.

6 -0.y=sin(x.5 3 3.5 1 1.2 -0.5 5 Line plot: x=0:0.05:5.4 -0.y).4 0.plot(x.2 0 -0.5 2 2.5 4 4.^2).8 0.What kind of graphics is possible in Matlab? 1 0.8 -1 0 0. 7 .6 0.

3 0.5 4 Stem plot: x = 0:0.5 3 3. y = sin(x.5 1 1.1 0. stem(x.35 0.05 -0.1:4.25 0.*exp(-x).1 -0.15 0 0.05 0 -0.y) 8 .2 0.^2)..15 0.5 2 2.What kind of graphics is possible in Matlab? 0.

What kind of graphics is possible in Matlab? 10 5 0 -5 -10 30 20 10 0 0 5 10 15 20 25 Mesh plot: z=peaks(25). mesh(z). 9 .

What kind of graphics is possible in Matlab? 10 5 0 -5 -10 30 20 10 0 0 5 10 15 20 25 Surface plot: z=peaks(25)... surf(z). 10 . colormap(jet).

contour(z.16).What kind of graphics is possible in Matlab? 25 20 15 10 5 5 10 15 20 25 Contour plot: z=peaks(25). 11 .

What kind of graphics is possible in Matlab? 12 .

Vectors are special forms of matrices and contain only one row OR one column. Scalars are matrices with only one row AND one column . For our purposes a matrix can be thought of as an array. that is how it is stored.MATLAB variables Matlab treats all variables as matrices. in fact.

digits.Identifiers in Matlab Have not to be previously declared Variable names can contain up to 63 characters Variable names must start with a letter followed by letters. and underscores. Variable names are case sensitive .

0/0 realmin The smallest usable positive real number realmax number The largest usable positive real .g.Matlab Special Variables ans Default variable name for results pi Value of π eps Smallest incremental number inf Infinity NaN Not a number e.

Data Types .