Uploaded by Jawad Amir

Presentation (1)

advertisement
 Presented
by BS mathematics
Uqba Saeed
Sidra Tariq
Areeb Shabir
Rafia Naveed
Sana Asif
MATLAB
History of MATLAB

The first early version of MATLAB was completed in the late 1970s. The
software was disclosed to the public for the first time in February 1979 at the
Naval Postgraduate School in California. Early versions of MATLAB were simple
matrix calculators with 71 pre-built functions.

MATLAB was invented by mathematician and computer programmer Cleve
Moler. The idea for MATLAB was based on his 1960s PhD thesis. Moler became
a math professor at the University of New Mexico and started developing
MATLAB for his students as a hobby.
Overview

MATLAB is a programming platform designed specifically
for engineers and scientists to analyze and design systems
and products that transform our world. The heart of
MATLAB is the MATLAB language, a matrix-based language
allowing the most natural expression of computational
mathematics.
What is MATLAB?

A high level programming language.

An interactive technical computing environment.

Algorithm development

Data analysis and visualization

Numerical computation

Faster than traditional computing language like C, C++ and fortran etc.
Advantages and disadvantages of
MATLAB
Advantages

Ease of use.

Powerful built_in routine and tool
boxes.

Good visualization of results.

Popularity in both academia and
research.
Disadvantages


Can be slow.( MATLAB is an
interpreted language).
Must be licensed( its not free).
Application domain

Numerical computation: linear algebra , statistics, fourier analysis,
filtering, optimization and numerical integration.

Signal and image processing.

Communication system.

Control design.

Test and measurement.

Financial modeling and analysis.

Computational biology.
MATLAB Environment

The matlab desktop environment consists of four main windows:
1.
Command window
2.
Command History
3.
Current Folder window
4.
Workspace Browser
Description

Command Window: A place where you type the command and instruction
of MATLAB.

Command History records all the commands entered in the command
window.

Current Folder is the directory where you can save your work.

All the files and folder of the current folder are listed in the current folder
browser.

Workspace Browser is a place where all variables in the MATLAB’s current
session are stored and success.
MATLAb desktop
MATLAB is matrix laboratory

In a MATLAB environment , a matrix is a rectangular array of numbers .

Entering matrix into MATLAB
1.
Explicit lists of element.
2.
Load from external files .
3.
Generate matrix using built-in functions.

By default, MATLAB functions operate directly on matrix and no iteration
logic need to be implemented.
Accessing Matrix Elements

The element in row i and column j of A is denoted by A(I, j).

It is also possible to refer of the elements of a matrix with a single subscript,
A(k).

Matrix size is adaptive and increase with assignments outside the limit.

Referring to outside location leads to error.
Basic Programming Components

Variables

Operators

MATLAB expression

Functions

Matrix
Matrix laboratory

1.
Standard matrix generation
Zeros, ones,, eye, Rand, randn.

Load functions can be used to read binary files containing matrix from
earlier session or text file containing data.

Concatenation is the process of joining small matrixes to make bigger
ones The pair of .square brackets[] is the concatenation operator.

Rows and columns can be deleted using a pair of square brackets.
Matrix generation

Entering a matrix:
1.
Begin with a square bracket[ .
2.
Separate elements in a row with spaces or commas ( , ).
3.
Use a semicolon (;) to separate a rows.
4.
End the matrix with another square bracket ].
Subtraction of matrices
Variables and numbers

MATLAb does not require any type declarations and dimensions statements.

MATLAB uses conventional decimal notation,
1.
Scientific notation uses the letter e to specify the power –of-ten scale
factor.
2.
Imaginary numbers uses either I or J as a suffix.

MATLAB stores all the numbers internally using the long format specified by
the floating _ point standard.
MATLAb Data Types
Integers
Mathematical Functions

Lists of built_in mathematical functions.

Elementary functions

Help elfun

Special functions

Help specfun

Such as

Sin(x) , cos(x), tan(x), e^x, ln (x).
MATLAB Functions

MATLAb provides a large number of standard elementary mathematical
functions and other applications domain functions.

These functions treat scalar and vectors in a similar way.

They work both for real and complex data making complex computation very
easy.

Some of the functions are built_in.

Built_in functions are part of the MATLAb core so they are very efficient, but
the computational details are not readily accessible. Other functions are
implemented in the MATLAb programming language, so their computational
details are accessible.
Creating a graph

The type of graph you choose to create depends on the nature of your data
and what you want to reveal about the data .

You can choose to many predefined graph such as line, bar , histogram and
pie graphs as well as 3_D graph , such as surfaces, slice planes and
streamlines.

There are two basic ways to create MATLAB graphs:
1.
Plotting tools to create graph interactively.
2.
Using CLI.
Graph Components

MATLAb graphs displays in a special window known as figure.

Therefore, every graph is placed within axes defining a coordinate system ,
which are contained by the figure.

You achieve the actual visual representation of the data with graphics
objects like lines and surfaces.
Plotting elementary functions
Multiple data sets in one plot
Questions:

What is MATLAB? Write advantages and disadvantages of MATLAB.

Write the applications of MATLAB and discuss the MATLAB environment.

Explain the matrices formation in MATLAB.

Describe the functions of MATLAB.

What are the component of graphs .How to create graphs in MATLAB? Also
draw a graph.
Thank you
Download