6 views

Uploaded by Hesham Fadl-Allah Mohamad

introducing Matlab

- What is Matlab
- Ibm Placement Papers
- MATLAB Introduction
- Symbolic Math Toolbox
- _+14+M11+Eq.+in+3D+no+conn
- matlabsym
- 91847v00_NN10_FA_BU.pdf
- Matlab Imaging Tutorial
- MATLAB Fundamentals-An Overview UGC ASC Burdwan Univ Sept2013
- updocs.net_ivivc.pdf
- Mathematics.pdf
- Biot Savart Law
- Lab1
- Upload a Document _ Scribd
- module 1 parent letter
- Course Pla
- 0046351914bd4263d3000000.pdf
- SampleExam16s2
- Intro Tom at Lab
- Math Lab Orientation

You are on page 1of 23

to

MATLAB

By Hisham Abuella

TA & RA in ECE @ Istanbul ehir University

Email : hishamabuella@std.sehir.edu.tr

Outline

Where to use MATLAB ?

What is Matlab ?

MATLAB Desktop

Exercise 1

Matrices & Vectors

Exercise 2

Useful Sites

2-D and 3-D Plotting and graphics

Linear Algebra

Algebraic Equations

Statistics

Data Analysis

Calculus and Differential Equations

Numerical Calculations

Integration

Transforms

Curve Fitting

What is Matlab ?

Stands for MATrix LABoratory

Interpreted language (Line by Line)

Scientific programming environment ( cos , sin , ....)

Very good tool for the manipulation of matrices ( rank , inv ....)

Great visualisation capabilities ( plot , stem ....)

Loads of built-in functions ( Use help you will be surprised...)

Easy to learn and simple to use ( Use help of matlab + lot of online

examples ....)

MATLAB Desktop

1- Command Window

2- Command History

3- Workspace

4- Current Directory

1- Is the matlab installed on your computer ?

search for matlab ...

2- Use

http://www.tutorialspoint.com/matlab/try_matlab.php

https://youtu.be/PfklSSxZSZU?t=43s

Exercise 1

Hint :

^ : power

sqrt: square root

23 = (2^3)

Solutions to Exercise 1

https://youtu.be/rZuAns0iEt4?t=20s

Nearly every thing in MATLAB is in matrices

Easy to define: >> A = [16 3; 5 10]

A =

16

3

10

use ; to separate rows

Try the same line without the semicolon and comments

>>A(1,2)

ans=

3

Remember Matrix(row,column)

Vectors - special case

-n=1

- m=1

column vector

row vector

The : operator

VERY important operator in Matlab

Means to

>> 1:10

ans =

1 2 3 4 5 6 7 8 9 10

For Matrix

>>A(3,2:3)

ans =

1 7

>>A(:,2)

ans =

2

1

1

Whatll happen if you type A(:,:) ?

Creating Vectors

1- Create vector with equally spaced intervals

x=0:0.5:pi

2- Create vector with n equally spaced intervals

x=linspace(0, pi, 7)

Note: MATLAB uses pi to represent , uses i or j to represent imaginary unit

Creating Matrices

zeros(m, n): matrix with all zeros

ones(m, n): matrix with all ones.

eye(m, n): the identity matrix

randn(m, n): normally distributed random

+: addition

-: subtraction

^: exponentiation

*: multiplication

/: division

Manipulating Vectors

Evaluated element by element

.'

.^

.*

./

: array power

: array multiplication

: array division

Manipulating Matrices

Try These :

>> A '

% transpose

-For : A =

>> B*A

% matrix multiplication

4

>> B.*A

% element by element multiplication

5

>> A\B

% left division same as INV(A)*B

2

>> B/A

% matrix division

>> B./A

% element by element division

>> [B A]

% Join matrices (horizontally)

>> [B; A]

% Join matrices (vertically)

>> A-B

% Subtract B from A

>> A^2

% calculate A square

& B=

2 1

4 -1

0 7

-1

4

2

3

6

0

1

8

2

mean(A):mean value of a vector

sum(A): summation.

sort(A): sorted vector

det(A) : determinant of a square matrix

Inv(A): Inverse of a matrix A

Exercise 2

Exercise 2 (Continue)

Solutions

https://youtu.be/pTdkD1UpGjU?t=28s

HW

Useful Sites

http://www.see.ed.ac.uk/teaching/courses/matlab/

http://www.tutorialspoint.com/matlab/matlab_overview.htm

http://www.mathworks.com/help/matlab/index.html

http://www.mathworks.co.uk/matlabcentral/

Plots in Matlab Try: stem , plot ......

Relational & Logical Operators Try: && > == ||.....

If-Else Statement

For Loops

While Loops

Functions and Scripts

- What is MatlabUploaded bynehanag
- Ibm Placement PapersUploaded byDhamo Dharan
- MATLAB IntroductionUploaded byAshirbad Swain
- Symbolic Math ToolboxUploaded byAnonymous 834jcl1l4
- _+14+M11+Eq.+in+3D+no+connUploaded byJared Coffin
- matlabsymUploaded byAbdallah E. Abdallah
- 91847v00_NN10_FA_BU.pdfUploaded byAdar Os
- Matlab Imaging TutorialUploaded byCosmin Fartat
- MATLAB Fundamentals-An Overview UGC ASC Burdwan Univ Sept2013Uploaded byNiladri Dey
- updocs.net_ivivc.pdfUploaded bylion king
- Mathematics.pdfUploaded byChandana Roy
- Biot Savart LawUploaded byAli Ahmad
- Lab1Uploaded byAli Ahmad
- Upload a Document _ ScribdUploaded byfdggd
- module 1 parent letterUploaded byapi-291222441
- Course PlaUploaded byleserdrac333
- 0046351914bd4263d3000000.pdfUploaded byHimanish Gupta
- SampleExam16s2Uploaded byElijah Mercado
- Intro Tom at LabUploaded bymagic1111
- Math Lab OrientationUploaded byMutiara Istiqomah
- MATLAB ProgrammingUploaded byAlain Gonzalez Dominguez
- Proof 2Uploaded byKaushik Guha
- MTH302BusinessMathematicsStatisticsUploaded byTabassum Batool
- Locating Facilities 2Uploaded byShahzad Hassan Jaffar
- Mat Lab Tutorial Part 1Uploaded byHoria Stefan Matei
- L16_Arrays4Uploaded byUsuario Tipo
- Traffic Forecasting & Network Planning - Lec 08Uploaded bypakmuzammils
- pseudo-dynamic techniques.pdfUploaded bySSS
- Opencv IntroUploaded byRajasekhar Karawalla
- C1_1Uploaded byDonaugu

- Peak to Average Power Ratio.pptxUploaded byHesham Fadl-Allah Mohamad
- Revision on MATLAB & Image Processing With MatlabUploaded byHesham Fadl-Allah Mohamad
- Intro to MatlabUploaded byHesham Fadl-Allah Mohamad
- Matlab OverviewUploaded byHesham Fadl-Allah Mohamad
- Fourier TransformUploaded byHesham Fadl-Allah Mohamad
- Fourier TransformUploaded byVaibhav Patil
- Telecommunications DemystifiedUploaded byHesham Fadl-Allah Mohamad
- lab_guideUploaded byHesham Fadl-Allah Mohamad
- SlidesUploaded byAkif Aslan
- Interview Electronics Communications Interview Questions and AnswersUploaded byHesham Fadl-Allah Mohamad
- NetworkingUploaded byMohd Yaseen
- LPCCimportant !!Uploaded byHesham Fadl-Allah Mohamad

- Ready-Mix Concrete (RMC Plant)-627631-.pdfUploaded byHarshada Hikare
- Questions of BSWUploaded byKrishna Veni Senthil Kumar
- Funa v CSCUploaded byFAtty. LD
- Confirmation letter Mr. V.pdfUploaded byAntox Lumajang
- TAKitManual EnUploaded byDamir Merdan
- Attorney General's Opinion Feral CatsUploaded byWSET
- Mainstreaming Disability in Disaster Management Toolkit INDIA UNDPUploaded byVaishnavi Jayakumar
- Assembly Tools Planning for VE8100.DocxUploaded byRajiv Soni
- A New Source of Renewable Energy From Lightning Stroke (2)Uploaded byjafar_mukkunnam
- The Ukrainian Weekly 2009-46Uploaded byThe Ukrainian Weekly
- ACU Project Management Policy Final Oct 2015Uploaded byTao Chun Liu
- Engine Technology Progress In Japan - Alternative Fuels/EnginesUploaded bySusumu Ariga
- GK500 Series Mini AC Motor Drives A01Uploaded byFERNANDO DIAZ
- Armado Transmision D6GUploaded byServimaquinaria Millan Sac
- Vacuum cleaner manual.pdfUploaded bybusyspider
- GO RT No.670Uploaded byRajeev Reddy
- Ongc __ Ta FormatUploaded byasif raza
- Assigment 2 Vehicle DynamicsUploaded byChetan Reddy
- Qubino ZW+ safety reportUploaded bypaul
- Admin 2nd Assign CasesUploaded byBeverly Baluyot
- mullen amanda -- lesson planUploaded byapi-249411091
- Accountacny ansUploaded byVedant Agrawal
- Unitate de Protectie Transformator TPU TD410Uploaded byRazvan Sasu
- 298936433-Manual-Atl-sauter-Oper-Inst-Ba-695-Disc-Tool-Turret.pdfUploaded byVladimir Colombiano de Souza
- 2013 CSR ProjectUploaded byNyasha Svondo
- 51. lanuzaUploaded byMariel Ann Maningas
- 2140906 ACMUploaded byPoop
- How to Clean Up Your Label J DiazUploaded byrushmore01
- HouseholdUploaded byEnio Miguel Cano Lima
- D6334Uploaded byrimi7al