6 views

Uploaded by Hesham Fadl-Allah Mohamad

introducing Matlab

- Class 12 Minimum Prog in Maths for Board Exam 1
- Intro Tom at Lab
- Matlab Codes
- Vikram Mutneja (316049619)
- Introduction
- Matlab Tips
- Lab1
- Lab1
- dawdawd
- WEEK 1
- Lec1 Matlab Intro
- L01
- MATLAB Fundamentals
- LQG Benchmark for Performance Assessment Version 2.0
- Ackrmann's Formula 1
- Maths problems
- Syllabus for IIT-JEE
- Matrix - Assignment
- Acoustic Fingerprinting System
- 73701 92002v01 Improving Simulation Performance in Simulink

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

- Class 12 Minimum Prog in Maths for Board Exam 1Uploaded byBiswajeet Chakraborty
- Intro Tom at LabUploaded bymagic1111
- Matlab CodesUploaded byxforce
- Vikram Mutneja (316049619)Uploaded byMadalina Mirela Bivolaru
- IntroductionUploaded byAvery Poole
- Matlab TipsUploaded bySerch Villa
- Lab1Uploaded byAtif Imtiaz
- Lab1Uploaded byAli Ahmad
- dawdawdUploaded byKharolina Bautista
- WEEK 1Uploaded byfarahanisilias
- Lec1 Matlab IntroUploaded byahmad035
- L01Uploaded byaishuvc1822
- MATLAB FundamentalsUploaded bySrikanth Kodoth
- LQG Benchmark for Performance Assessment Version 2.0Uploaded byCharles
- Ackrmann's Formula 1Uploaded bymarciocefet
- Maths problemsUploaded byvijay9677
- Syllabus for IIT-JEEUploaded byJaun Kahan
- Matrix - AssignmentUploaded byapi-3742735
- Acoustic Fingerprinting SystemUploaded byAinuddin Faizan
- 73701 92002v01 Improving Simulation Performance in SimulinkUploaded byJoão Ferro
- Blind Spatial Signature Estimation RonVorSidGerSSEUploaded bySylviane Elhaj
- Matlab GUI TutorialUploaded byBaher Mawlawi
- 313 Chapter 5Uploaded byseamesb
- Dynamic IntrolabUploaded byJan Willem Feitsma
- seismicaUploaded byAlex Pantiru
- e LitmusUploaded byjohnvijay
- LeopoldUploaded byManuel Montenegro Pérez
- Chapter 03Uploaded byمهند عدنان الجعفري
- 20040121019_2004117340Uploaded byRohit Sajjan
- JeeUploaded byAanand Nayyar

- Fourier TransformUploaded byVaibhav Patil
- Peak to Average Power Ratio.pptxUploaded byHesham Fadl-Allah Mohamad
- Fourier TransformUploaded 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
- Çamlica Erkek Konukevi̇ Servi̇sleri̇ (28 Haziran - ...)Uploaded byHesham Fadl-Allah Mohamad
- Telecommunications DemystifiedUploaded byHesham Fadl-Allah Mohamad
- SlidesUploaded byAkif Aslan
- Interview Electronics Communications Interview Questions and AnswersUploaded byHesham Fadl-Allah Mohamad
- lab_guideUploaded byHesham Fadl-Allah Mohamad
- NetworkingUploaded byMohd Yaseen
- LPCCimportant !!Uploaded byHesham Fadl-Allah Mohamad
- اللاهوت العربيUploaded byHosamKusba

- Linear ProblemsUploaded bybenja010
- Vedic MathsUploaded byTB
- difinisi nombor bukan nisbah.docxUploaded byMinTan
- MA2224-ch0Uploaded byTom Davis
- Tentative_NumPy_Tutorial.pdfUploaded bylincol
- seminar math 2016 students St Mary.pdfUploaded byHadi Faizal Mohd Rosely
- erratasUploaded byAnonymous l6OMyp4w
- 1650169020000_Assgn-3-4Uploaded bySwaraj Panda
- Sage TutorialUploaded byAnonymous RsPjrrzfI4
- Foundation Knowledge (Module 2)Uploaded byLok Lam Szeto
- Ratio and Proportion_3Uploaded byahee_1
- Bravais LatticeUploaded byDiego Loaiza
- bmsc_fs12_11Uploaded byLuis Morales
- 09-330HW8SolsUploaded byoscura
- A Non-linear Black-Scholes EquationUploaded byHadiBies
- trig function graphs lesson planUploaded byapi-204970231
- 3-2Uploaded byksr131
- Higher-order functions - Functional ProgrammingUploaded byNiculcea Radu
- Multiple IntegralsUploaded byPancham Alva
- Concepts of Sliding Mode ControlUploaded bySatyavir Yadav
- QFT I Problem HomeworkUploaded byDaniel Salinas-Arizmendi
- SIMO Combi InvarianceUploaded byKhor Shi-Jie
- potions completeUploaded byapi-376226040
- The Primes Matrix, the Prime Pair Sets and the Curious Behavior of Prime NumbersUploaded byMichael McKee
- Rudiments of Io AnalysisUploaded byJay-ar Mira
- NDCSPB.pdfUploaded byneel1237
- Gravity ClassesUploaded byAbhishek Jain
- Appendix-I C3 the Eikonal EquationUploaded bypykarem
- Green's Function in Spherical Polar CoordinatesUploaded byRaymart Jay Canoy
- HELMHOLTZ THEOREMUploaded byrahpooye313