SlideShare a Scribd company logo
Chapter 01
COURSE CODE: CEB 40403
USE OF MATLAB IN PROBLEM SOLVING
4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 1
Learning
outcomes
4/5/2016
Simple calculations through MATLAB
Use of variables and functions
Matrices and Vectors
Plotting and visualization in MATLAB
DR. MOHAMMED DANISH/UNIKL-MICET 2
Introduction
High level language for technical computing
Stands for MATrix LABoratory
Everything is a matrix - easy to do linear algebra
4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 3
Menu and toolbar
Workspace
History
Command
Saved files
4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 4
Simple calculations
a= b+c
If b=4, c=7
Then a=11
Similarly, a= z+b(c+d)
If z=-2, b=3, c=2 and d=6
Then, a=-2+3(2+6)=16
4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 5
Use of Variables and
functions
f(x)=a.x+b
Where x=independent variable and ‘a’
and ‘b’ are constants, and f(x) is
dependent variable.
If, a=2, and b=3, and x=-1, 0, 1
Then f(x)=1, 2, and 5
4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 6
Variable names
MATLAB legal names consist of any combination of letters and digits,
starting with a letter. Eg. NetCost, Left2Pay, X3, x3 Z25c5 etc.
These are not allowed as variable names in MATLAB eg., Net-Cost,
2Pay, %x, @sign, sin cos, tan etc.
Special names: you should avoid using eps, pi, I, j (both represents
imaginary number
1
4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 7
Functions
Trigonometric functions: those known to MATLAB are sin, cos, tan and
their arguments should be in radians. E.g 30o=pi/6 radians
The inverse trigonometric functions are called as: asin, acos, atan etc.
the results are in radian.
Other functions: sqrt, exp, log, log10.
4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 8
Vectors
Vectors are classified as in two types:
Row vector: they are list of numbers separated by either commas or
spaces. The number of entries is known as the length of the vector and
the entries are often referred as “elements” or “components” of the
vector.
>>v=[1 3, sqrt(5)]
Column vector: to create a column vector type the left square bracket[
and then enter the element with a semicolon between them.
>>cv=[1; 2; 3; 4]
4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 9
Matrices and Vectors
Linear systems of algebraic equations:
11 1 12 2 13 3 1 1
21 1 22 2 23 3 2 2
1 1 2 2 23
...............
................ a
..
..
..
.................
N N
N N
N N NN N N
a x a x a x a x b
a x a x a x x b
a x a x a x a x b
   
   
   
is the constant coefficients (assume) real that multiply with independent Variable,
in above equation is the constant for right hand side of eq.
ija
jx ib
4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 10
Consider a system:
It is common to write linear equations in matrix form as:
1 2 3
1 2 3
1 2 3
4
2 3 7
3 6 2
x x x
x x x
x x x
  
  
  
11 12 13 1 1
21 22 23 2 2
31 32 33 3 3
a a a x b
a a a x b
a a a x b

4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 11
1
2
3
,
1 1 1 4
2 1 3 7
3 1 6 2
Ax b
where
x
A b x x
x

  
19
7
8
x  

4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 12
Plotting and visualization
MATLAB used plot command to create two dimensional plots.
The instruction can be written in following way: plot(x,y)
The arguments x and y are each a vector (one-dimensional array). The
two vectors must have the same number of elements.
The x-values on the abscissa (horizontal axis) and the y-values on the
ordinate (vertical axis)
4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 13
Some specific commands for
plot
Notes about using the specifiers:
The specifiers are typed inside the plot command as strings.
Within the string the specifiers can be typed in any order.
The specifiers are optional. This means that none, one, two, or all three types can be
included in a command.
Some examples:
plot(x,y) A blue solid line connects the points with no markers (default).
plot(x,y,‘r’) A red solid line connects the points.
plot(x,y,‘--y’) A yellow dashed line connects the points.
plot(x,y,‘*’) The points are marked with * (no line between the points).
plot(x,y,‘g:d’) A green dotted line connects the points that are marked with diamond
markers.
4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 14
Example plot
Year 1988 1989 1990 1991 1992 1993 1994
Sales
(millions)
8 12 20 22 18 24 27
To plot this data, the list of years is assigned to one vector (namely yr),
and the corresponding sales data is assigned to a second vector (named sle). The
command window where the vectors are created and the plot command is used is
shown below:
>> yr=[1988:1:1994];
>> sle=[8 12 20 22 18 24 27];
>> plot(yr,sle,'--r*','linewidth',2,'markersize',12)
4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 15
Practice question
Solve the following equations using MATLAB:
2 3 1
5 7 3
x y
x y
 
 
2 3 1
5 7 3
2
1
x
y
x
y
     
     
     
   
      
4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 16
Summary of topic
Simple calculation using MATLAB
Difference between function and variable, Row vector and column
vector, vector and matrices.
Formation of matrices from linear equations
Use MATLAB in plot and visualization.
4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 17
End of slides for
chapter one
Dr. Mohammed Danish
Sr. Lecturer, Malaysian Institute of Chemical and
bioengineering Technology (MICET)-Universiti
Kuala Lumpur, Alor Gajah, Melaka, Malaysia
4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 18

More Related Content

What's hot

Bresenham algorithm
Bresenham algorithmBresenham algorithm
Interesting Mathematics3- Belgium
Interesting Mathematics3- BelgiumInteresting Mathematics3- Belgium
Interesting Mathematics3- Belgium
Mihaela Ursachi
 
8 6 Notes
8 6 Notes8 6 Notes
maXbox starter68 machine learning VI
maXbox starter68 machine learning VImaXbox starter68 machine learning VI
maXbox starter68 machine learning VI
Max Kleiner
 
Applied Calculus: An introduction about Real Numbers and Real Line
Applied Calculus: An introduction about Real Numbers and Real LineApplied Calculus: An introduction about Real Numbers and Real Line
Applied Calculus: An introduction about Real Numbers and Real Line
baetulilm
 
5.8 Graphing quadratic inequalities
5.8 Graphing quadratic inequalities5.8 Graphing quadratic inequalities
5.8 Graphing quadratic inequalitiesswartzje
 
2D & 3D Modelling with Mathematica
2D & 3D Modelling with Mathematica2D & 3D Modelling with Mathematica
2D & 3D Modelling with MathematicaMiles Ford
 
Permutation graphsandapplications
Permutation graphsandapplicationsPermutation graphsandapplications
Permutation graphsandapplicationsJoe Krall
 
Assignment method
Assignment methodAssignment method
Assignment method
R A Shah
 
Interpolation and-its-application
Interpolation and-its-applicationInterpolation and-its-application
Interpolation and-its-application
Apurbo Datta
 
Assignment problem
Assignment problemAssignment problem
Assignment problem
Anggy Herny Anggraeni
 
Matrix Manipulation in Matlab
Matrix Manipulation in MatlabMatrix Manipulation in Matlab
Matrix Manipulation in Matlab
Mohamed Loey
 
Math Section 2.2 ECC Etudes
Math Section 2.2 ECC EtudesMath Section 2.2 ECC Etudes
Math Section 2.2 ECC EtudesDavidYeeElCamino
 
Matrix Multiplication (University presentation slide)
Matrix Multiplication (University presentation slide) Matrix Multiplication (University presentation slide)
Matrix Multiplication (University presentation slide)
Badhon Biswas
 
Digital Logic Design-Lecture 5
Digital Logic Design-Lecture 5Digital Logic Design-Lecture 5
Digital Logic Design-Lecture 5
Samia Sultana
 
Efficient Estimation for High Similarities using Odd Sketches
Efficient Estimation for High Similarities using Odd Sketches Efficient Estimation for High Similarities using Odd Sketches
Efficient Estimation for High Similarities using Odd Sketches
AXEL FOTSO
 
Lecture 1 admin & representing fcts
Lecture 1   admin & representing fctsLecture 1   admin & representing fcts
Lecture 1 admin & representing fcts
njit-ronbrown
 
Specialized indexing for NoSQL Databases like Accumulo and HBase
Specialized indexing for NoSQL Databases like Accumulo and HBaseSpecialized indexing for NoSQL Databases like Accumulo and HBase
Specialized indexing for NoSQL Databases like Accumulo and HBase
Jim Klucar
 
Application of Matrices
Application of MatricesApplication of Matrices
Application of Matrices
Mohammed Limdiwala
 

What's hot (20)

Bresenham algorithm
Bresenham algorithmBresenham algorithm
Bresenham algorithm
 
Interesting Mathematics3- Belgium
Interesting Mathematics3- BelgiumInteresting Mathematics3- Belgium
Interesting Mathematics3- Belgium
 
8 6 Notes
8 6 Notes8 6 Notes
8 6 Notes
 
maXbox starter68 machine learning VI
maXbox starter68 machine learning VImaXbox starter68 machine learning VI
maXbox starter68 machine learning VI
 
Applied Calculus: An introduction about Real Numbers and Real Line
Applied Calculus: An introduction about Real Numbers and Real LineApplied Calculus: An introduction about Real Numbers and Real Line
Applied Calculus: An introduction about Real Numbers and Real Line
 
5.8 Graphing quadratic inequalities
5.8 Graphing quadratic inequalities5.8 Graphing quadratic inequalities
5.8 Graphing quadratic inequalities
 
2D & 3D Modelling with Mathematica
2D & 3D Modelling with Mathematica2D & 3D Modelling with Mathematica
2D & 3D Modelling with Mathematica
 
Permutation graphsandapplications
Permutation graphsandapplicationsPermutation graphsandapplications
Permutation graphsandapplications
 
Assignment method
Assignment methodAssignment method
Assignment method
 
Interpolation and-its-application
Interpolation and-its-applicationInterpolation and-its-application
Interpolation and-its-application
 
Assignment problem
Assignment problemAssignment problem
Assignment problem
 
Matrix Manipulation in Matlab
Matrix Manipulation in MatlabMatrix Manipulation in Matlab
Matrix Manipulation in Matlab
 
Math Section 2.2 ECC Etudes
Math Section 2.2 ECC EtudesMath Section 2.2 ECC Etudes
Math Section 2.2 ECC Etudes
 
Assignment 1
Assignment 1Assignment 1
Assignment 1
 
Matrix Multiplication (University presentation slide)
Matrix Multiplication (University presentation slide) Matrix Multiplication (University presentation slide)
Matrix Multiplication (University presentation slide)
 
Digital Logic Design-Lecture 5
Digital Logic Design-Lecture 5Digital Logic Design-Lecture 5
Digital Logic Design-Lecture 5
 
Efficient Estimation for High Similarities using Odd Sketches
Efficient Estimation for High Similarities using Odd Sketches Efficient Estimation for High Similarities using Odd Sketches
Efficient Estimation for High Similarities using Odd Sketches
 
Lecture 1 admin & representing fcts
Lecture 1   admin & representing fctsLecture 1   admin & representing fcts
Lecture 1 admin & representing fcts
 
Specialized indexing for NoSQL Databases like Accumulo and HBase
Specialized indexing for NoSQL Databases like Accumulo and HBaseSpecialized indexing for NoSQL Databases like Accumulo and HBase
Specialized indexing for NoSQL Databases like Accumulo and HBase
 
Application of Matrices
Application of MatricesApplication of Matrices
Application of Matrices
 

Similar to 01 Chapter MATLAB introduction

An Introduction to MATLAB with Worked Examples
An Introduction to MATLAB with Worked ExamplesAn Introduction to MATLAB with Worked Examples
An Introduction to MATLAB with Worked Examples
eAssessment in Practice Symposium
 
04 Chapter MATLAB linear algebra review
04 Chapter MATLAB linear algebra review04 Chapter MATLAB linear algebra review
04 Chapter MATLAB linear algebra review
Dr. Mohammed Danish
 
03 Chapter MATLAB finite precision arithmatic
03 Chapter MATLAB finite precision arithmatic03 Chapter MATLAB finite precision arithmatic
03 Chapter MATLAB finite precision arithmatic
Dr. Mohammed Danish
 
Matlab intro notes
Matlab intro notesMatlab intro notes
Matlab intro notes
pawanss
 
Intro to mathcad
Intro to mathcadIntro to mathcad
Intro to mathcad
Sergio Carvalho
 
Subquad multi ff
Subquad multi ffSubquad multi ff
Subquad multi ff
Fabian Velazquez
 
Idea for ineractive programming language
Idea for ineractive programming languageIdea for ineractive programming language
Idea for ineractive programming language
Lincoln Hannah
 
Chapter 01.ppt
Chapter 01.pptChapter 01.ppt
Chapter 01.ppt
JulijaKaraliunaite1
 
Chapter 01.ppt
Chapter 01.pptChapter 01.ppt
Chapter 01.ppt
JulijaKaraliunaite1
 
Matlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingMatlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processing
Dr. Manjunatha. P
 
Mm chap08 -_lossy_compression_algorithms
Mm chap08 -_lossy_compression_algorithmsMm chap08 -_lossy_compression_algorithms
Mm chap08 -_lossy_compression_algorithms
Eellekwameowusu
 
Business Mathematics in decision making
Business Mathematics in decision makingBusiness Mathematics in decision making
Business Mathematics in decision making
Fahad Fu
 
IRJET- An Efficient Reverse Converter for the Three Non-Coprime Moduli Set {4...
IRJET- An Efficient Reverse Converter for the Three Non-Coprime Moduli Set {4...IRJET- An Efficient Reverse Converter for the Three Non-Coprime Moduli Set {4...
IRJET- An Efficient Reverse Converter for the Three Non-Coprime Moduli Set {4...
IRJET Journal
 
Mmc manual
Mmc manualMmc manual
Mmc manual
Urvi Surat
 
Rsh qam11 ch04 ge
Rsh qam11 ch04 geRsh qam11 ch04 ge
Rsh qam11 ch04 ge
Firas Husseini
 
Basics of programming in matlab
Basics of programming in matlabBasics of programming in matlab
Basics of programming in matlabAKANKSHA GUPTA
 
Basic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptxBasic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptx
PremanandS3
 

Similar to 01 Chapter MATLAB introduction (20)

An Introduction to MATLAB with Worked Examples
An Introduction to MATLAB with Worked ExamplesAn Introduction to MATLAB with Worked Examples
An Introduction to MATLAB with Worked Examples
 
04 Chapter MATLAB linear algebra review
04 Chapter MATLAB linear algebra review04 Chapter MATLAB linear algebra review
04 Chapter MATLAB linear algebra review
 
03 Chapter MATLAB finite precision arithmatic
03 Chapter MATLAB finite precision arithmatic03 Chapter MATLAB finite precision arithmatic
03 Chapter MATLAB finite precision arithmatic
 
Matlab intro notes
Matlab intro notesMatlab intro notes
Matlab intro notes
 
Intro to mathcad
Intro to mathcadIntro to mathcad
Intro to mathcad
 
Subquad multi ff
Subquad multi ffSubquad multi ff
Subquad multi ff
 
Idea for ineractive programming language
Idea for ineractive programming languageIdea for ineractive programming language
Idea for ineractive programming language
 
Es272 ch1
Es272 ch1Es272 ch1
Es272 ch1
 
Chapter 01.ppt
Chapter 01.pptChapter 01.ppt
Chapter 01.ppt
 
Chapter 01.ppt
Chapter 01.pptChapter 01.ppt
Chapter 01.ppt
 
Matlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingMatlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processing
 
Mm chap08 -_lossy_compression_algorithms
Mm chap08 -_lossy_compression_algorithmsMm chap08 -_lossy_compression_algorithms
Mm chap08 -_lossy_compression_algorithms
 
Business Mathematics in decision making
Business Mathematics in decision makingBusiness Mathematics in decision making
Business Mathematics in decision making
 
gmrit-cse
gmrit-csegmrit-cse
gmrit-cse
 
IRJET- An Efficient Reverse Converter for the Three Non-Coprime Moduli Set {4...
IRJET- An Efficient Reverse Converter for the Three Non-Coprime Moduli Set {4...IRJET- An Efficient Reverse Converter for the Three Non-Coprime Moduli Set {4...
IRJET- An Efficient Reverse Converter for the Three Non-Coprime Moduli Set {4...
 
Mmc manual
Mmc manualMmc manual
Mmc manual
 
Rsh qam11 ch04 ge
Rsh qam11 ch04 geRsh qam11 ch04 ge
Rsh qam11 ch04 ge
 
xldb-2015
xldb-2015xldb-2015
xldb-2015
 
Basics of programming in matlab
Basics of programming in matlabBasics of programming in matlab
Basics of programming in matlab
 
Basic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptxBasic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptx
 

More from Dr. Mohammed Danish

Instrumental method of analysis Oil and Fat(Unit 7 b)
Instrumental method of analysis Oil and Fat(Unit 7 b)Instrumental method of analysis Oil and Fat(Unit 7 b)
Instrumental method of analysis Oil and Fat(Unit 7 b)
Dr. Mohammed Danish
 
Analysis of oil and Fat(Unit 7)
Analysis of oil and Fat(Unit 7)Analysis of oil and Fat(Unit 7)
Analysis of oil and Fat(Unit 7)
Dr. Mohammed Danish
 
Non edible application of oil and Fat (Unit 6 b)
Non edible application of oil and Fat (Unit 6 b)Non edible application of oil and Fat (Unit 6 b)
Non edible application of oil and Fat (Unit 6 b)
Dr. Mohammed Danish
 
Oil and Fat edible applications (Unit 6 a)
Oil and Fat edible applications (Unit 6 a)Oil and Fat edible applications (Unit 6 a)
Oil and Fat edible applications (Unit 6 a)
Dr. Mohammed Danish
 
Fatty acid reaction and derivatives (Unit 5 b)
 Fatty acid reaction and derivatives (Unit 5 b) Fatty acid reaction and derivatives (Unit 5 b)
Fatty acid reaction and derivatives (Unit 5 b)
Dr. Mohammed Danish
 
Fatty acid clusters (Unit 5 a)
Fatty acid clusters (Unit 5 a) Fatty acid clusters (Unit 5 a)
Fatty acid clusters (Unit 5 a)
Dr. Mohammed Danish
 
Production of Glycerin (Unit 4 b)
Production of Glycerin (Unit 4 b) Production of Glycerin (Unit 4 b)
Production of Glycerin (Unit 4 b)
Dr. Mohammed Danish
 
Fatty Acid Isolation (Unit 4 a)
Fatty Acid Isolation (Unit 4 a)Fatty Acid Isolation (Unit 4 a)
Fatty Acid Isolation (Unit 4 a)
Dr. Mohammed Danish
 
Processing of edible oil (Unit 3)
Processing of edible oil (Unit 3)Processing of edible oil (Unit 3)
Processing of edible oil (Unit 3)
Dr. Mohammed Danish
 
Chemical and Physical properties of Oil and Fat (Unit 2)
Chemical and Physical properties of Oil and Fat (Unit 2)Chemical and Physical properties of Oil and Fat (Unit 2)
Chemical and Physical properties of Oil and Fat (Unit 2)
Dr. Mohammed Danish
 
Introduction of Edible oils (Unit 1)
Introduction of Edible oils (Unit 1) Introduction of Edible oils (Unit 1)
Introduction of Edible oils (Unit 1)
Dr. Mohammed Danish
 
08-09 Chapter numerical integration
08-09  Chapter numerical integration 08-09  Chapter numerical integration
08-09 Chapter numerical integration
Dr. Mohammed Danish
 
06-07 Chapter interpolation in MATLAB
06-07 Chapter interpolation in MATLAB06-07 Chapter interpolation in MATLAB
06-07 Chapter interpolation in MATLAB
Dr. Mohammed Danish
 
05 Chapter MATLAB Differntial equations
05 Chapter MATLAB Differntial equations05 Chapter MATLAB Differntial equations
05 Chapter MATLAB Differntial equations
Dr. Mohammed Danish
 
02 MATLAB programming
02 MATLAB programming02 MATLAB programming
02 MATLAB programming
Dr. Mohammed Danish
 

More from Dr. Mohammed Danish (15)

Instrumental method of analysis Oil and Fat(Unit 7 b)
Instrumental method of analysis Oil and Fat(Unit 7 b)Instrumental method of analysis Oil and Fat(Unit 7 b)
Instrumental method of analysis Oil and Fat(Unit 7 b)
 
Analysis of oil and Fat(Unit 7)
Analysis of oil and Fat(Unit 7)Analysis of oil and Fat(Unit 7)
Analysis of oil and Fat(Unit 7)
 
Non edible application of oil and Fat (Unit 6 b)
Non edible application of oil and Fat (Unit 6 b)Non edible application of oil and Fat (Unit 6 b)
Non edible application of oil and Fat (Unit 6 b)
 
Oil and Fat edible applications (Unit 6 a)
Oil and Fat edible applications (Unit 6 a)Oil and Fat edible applications (Unit 6 a)
Oil and Fat edible applications (Unit 6 a)
 
Fatty acid reaction and derivatives (Unit 5 b)
 Fatty acid reaction and derivatives (Unit 5 b) Fatty acid reaction and derivatives (Unit 5 b)
Fatty acid reaction and derivatives (Unit 5 b)
 
Fatty acid clusters (Unit 5 a)
Fatty acid clusters (Unit 5 a) Fatty acid clusters (Unit 5 a)
Fatty acid clusters (Unit 5 a)
 
Production of Glycerin (Unit 4 b)
Production of Glycerin (Unit 4 b) Production of Glycerin (Unit 4 b)
Production of Glycerin (Unit 4 b)
 
Fatty Acid Isolation (Unit 4 a)
Fatty Acid Isolation (Unit 4 a)Fatty Acid Isolation (Unit 4 a)
Fatty Acid Isolation (Unit 4 a)
 
Processing of edible oil (Unit 3)
Processing of edible oil (Unit 3)Processing of edible oil (Unit 3)
Processing of edible oil (Unit 3)
 
Chemical and Physical properties of Oil and Fat (Unit 2)
Chemical and Physical properties of Oil and Fat (Unit 2)Chemical and Physical properties of Oil and Fat (Unit 2)
Chemical and Physical properties of Oil and Fat (Unit 2)
 
Introduction of Edible oils (Unit 1)
Introduction of Edible oils (Unit 1) Introduction of Edible oils (Unit 1)
Introduction of Edible oils (Unit 1)
 
08-09 Chapter numerical integration
08-09  Chapter numerical integration 08-09  Chapter numerical integration
08-09 Chapter numerical integration
 
06-07 Chapter interpolation in MATLAB
06-07 Chapter interpolation in MATLAB06-07 Chapter interpolation in MATLAB
06-07 Chapter interpolation in MATLAB
 
05 Chapter MATLAB Differntial equations
05 Chapter MATLAB Differntial equations05 Chapter MATLAB Differntial equations
05 Chapter MATLAB Differntial equations
 
02 MATLAB programming
02 MATLAB programming02 MATLAB programming
02 MATLAB programming
 

Recently uploaded

【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
NABLAS株式会社
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
ewymefz
 
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
2023240532
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Boston Institute of Analytics
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
ocavb
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
balafet
 
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
ukgaet
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
Subhajit Sahu
 
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
pchutichetpong
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
jerlynmaetalle
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
enxupq
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
nscud
 
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptxData_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
AnirbanRoy608946
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
TravisMalana
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
John Andrews
 
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
vcaxypu
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
axoqas
 
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdfSample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
Linda486226
 
Opendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptxOpendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptx
Opendatabay
 

Recently uploaded (20)

【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
 
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
 
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
 
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
 
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptxData_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
 
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
 
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdfSample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
 
Opendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptxOpendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptx
 

01 Chapter MATLAB introduction

  • 1. Chapter 01 COURSE CODE: CEB 40403 USE OF MATLAB IN PROBLEM SOLVING 4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 1
  • 2. Learning outcomes 4/5/2016 Simple calculations through MATLAB Use of variables and functions Matrices and Vectors Plotting and visualization in MATLAB DR. MOHAMMED DANISH/UNIKL-MICET 2
  • 3. Introduction High level language for technical computing Stands for MATrix LABoratory Everything is a matrix - easy to do linear algebra 4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 3
  • 4. Menu and toolbar Workspace History Command Saved files 4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 4
  • 5. Simple calculations a= b+c If b=4, c=7 Then a=11 Similarly, a= z+b(c+d) If z=-2, b=3, c=2 and d=6 Then, a=-2+3(2+6)=16 4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 5
  • 6. Use of Variables and functions f(x)=a.x+b Where x=independent variable and ‘a’ and ‘b’ are constants, and f(x) is dependent variable. If, a=2, and b=3, and x=-1, 0, 1 Then f(x)=1, 2, and 5 4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 6
  • 7. Variable names MATLAB legal names consist of any combination of letters and digits, starting with a letter. Eg. NetCost, Left2Pay, X3, x3 Z25c5 etc. These are not allowed as variable names in MATLAB eg., Net-Cost, 2Pay, %x, @sign, sin cos, tan etc. Special names: you should avoid using eps, pi, I, j (both represents imaginary number 1 4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 7
  • 8. Functions Trigonometric functions: those known to MATLAB are sin, cos, tan and their arguments should be in radians. E.g 30o=pi/6 radians The inverse trigonometric functions are called as: asin, acos, atan etc. the results are in radian. Other functions: sqrt, exp, log, log10. 4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 8
  • 9. Vectors Vectors are classified as in two types: Row vector: they are list of numbers separated by either commas or spaces. The number of entries is known as the length of the vector and the entries are often referred as “elements” or “components” of the vector. >>v=[1 3, sqrt(5)] Column vector: to create a column vector type the left square bracket[ and then enter the element with a semicolon between them. >>cv=[1; 2; 3; 4] 4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 9
  • 10. Matrices and Vectors Linear systems of algebraic equations: 11 1 12 2 13 3 1 1 21 1 22 2 23 3 2 2 1 1 2 2 23 ............... ................ a .. .. .. ................. N N N N N N NN N N a x a x a x a x b a x a x a x x b a x a x a x a x b             is the constant coefficients (assume) real that multiply with independent Variable, in above equation is the constant for right hand side of eq. ija jx ib 4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 10
  • 11. Consider a system: It is common to write linear equations in matrix form as: 1 2 3 1 2 3 1 2 3 4 2 3 7 3 6 2 x x x x x x x x x          11 12 13 1 1 21 22 23 2 2 31 32 33 3 3 a a a x b a a a x b a a a x b  4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 11
  • 12. 1 2 3 , 1 1 1 4 2 1 3 7 3 1 6 2 Ax b where x A b x x x     19 7 8 x    4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 12
  • 13. Plotting and visualization MATLAB used plot command to create two dimensional plots. The instruction can be written in following way: plot(x,y) The arguments x and y are each a vector (one-dimensional array). The two vectors must have the same number of elements. The x-values on the abscissa (horizontal axis) and the y-values on the ordinate (vertical axis) 4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 13
  • 14. Some specific commands for plot Notes about using the specifiers: The specifiers are typed inside the plot command as strings. Within the string the specifiers can be typed in any order. The specifiers are optional. This means that none, one, two, or all three types can be included in a command. Some examples: plot(x,y) A blue solid line connects the points with no markers (default). plot(x,y,‘r’) A red solid line connects the points. plot(x,y,‘--y’) A yellow dashed line connects the points. plot(x,y,‘*’) The points are marked with * (no line between the points). plot(x,y,‘g:d’) A green dotted line connects the points that are marked with diamond markers. 4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 14
  • 15. Example plot Year 1988 1989 1990 1991 1992 1993 1994 Sales (millions) 8 12 20 22 18 24 27 To plot this data, the list of years is assigned to one vector (namely yr), and the corresponding sales data is assigned to a second vector (named sle). The command window where the vectors are created and the plot command is used is shown below: >> yr=[1988:1:1994]; >> sle=[8 12 20 22 18 24 27]; >> plot(yr,sle,'--r*','linewidth',2,'markersize',12) 4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 15
  • 16. Practice question Solve the following equations using MATLAB: 2 3 1 5 7 3 x y x y     2 3 1 5 7 3 2 1 x y x y                              4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 16
  • 17. Summary of topic Simple calculation using MATLAB Difference between function and variable, Row vector and column vector, vector and matrices. Formation of matrices from linear equations Use MATLAB in plot and visualization. 4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 17
  • 18. End of slides for chapter one Dr. Mohammed Danish Sr. Lecturer, Malaysian Institute of Chemical and bioengineering Technology (MICET)-Universiti Kuala Lumpur, Alor Gajah, Melaka, Malaysia 4/5/2016 DR. MOHAMMED DANISH/UNIKL-MICET 18