SlideShare a Scribd company logo
1 of 27
EngMahmoud Hussein
APPLICATION
Solving linear equation
 Suppose that you would like to solve the following system of equations:
 2X+Y-Z=6
 X-Y-Z=-3
 X+2Y-3Z=-9
 In matrix form, you can write:
Solving linear equation
Quiz
• Write a vector start from zero and increment with 5 and end with 43.
• Write a vector with the following sequence[1 3 5 7 9 13 17 21 -2 -5 -7 -9]
• Create a vector and sort it.
• Create matrix [1 2 3;4 5 6;7 9 8] and delete second row.
• Solve the following equations
 2X+Y-Z=6
 X-Y-Z=-3
 X+2Y-3Z=-9
 Write a vector [1 2 3] and get the transpose.
Curve fitting
 Given a set of Inputs and outputs for a particular system; MATLAB can
find a polynomial function the fit the output to input.
 This is done using the polyfit instruction.
 p = polyfit(x,y,n) 􀃆 finds the coefficients of a polynomial p(x) of degree
n that fits the data, p(x(i)) to y(i), in a least squares sense.
Curve fitting
 Polynomial evaluation.
y = polyval(p,x)
Returns the value of a polynomial of degree n evaluated at x.
The input argument p is a vector of length n+1 whose elements are
the coefficients in descending powers of the polynomial to be
evaluated.
Curve fitting
 Polynomial evaluation.􀃆
Example:
Curve fitting
Example
p=polyfit(month,temp,2);
Curve fitting
 Graphical comparison
>>month=1:1:12;
 >>temp=[17 19 22 24 27 30 34 35 31 26 23 20];
 >>n=2;
 >>p=polyfit(month,temp,n);
 >>x=1:0.1:12;
 >>y=polyval(p,x);
 >>plot(month,temp,’r’,x,y,’g’)
Curve fitting
M-Files
• Text files containing MATLAB code.
• Useful for complex tasks.
 we can store the typed input into a file and
 tell MATLAB to get its input from that file.
 Extension: .m
 We can put comments on program to improve program quality and
enable to another programmer to edit.
M-Files
 If an m-􀃆le contains MATLAB statements just as you would type them
into MATLAB, theyare called scripts.
 M-􀃆les can also accept input and produce output, in which case they
are called functions.
 The MATLAB executes the instructions, just as if you had typed them in
the command window.
Polynomials
 Sometimes you need to:
Write a polynomial,
Find its roots,
Multiply it by another one,
Divide it by another polynomial,
Differentiate it,
Integrate it,
Substitute by a value in it, or
Put it in partial fractions form.
Polynomials
 MATLAB provides us with a complete set to handle polynomials.
 Polynomials are identified by their coefficients or by its roots.
 N th order polynomial is defined by a row array of length N+1
containing the coefficients of the polynomial ordered by descending
powers.
 Example:
 p = [1 0 -2 -5];
Operations on Polynomials
Operations on Polynomials
Convolution and deconvolution
 Polynomial multiplication 􀃆convolution
 Polynomial division 􀃆deconvolution.
 Example:
 C = conv(a,b) a*b (a,b are polynomials)
 􀃆 [Z,r] = deconv(C,a) Z = C/a = b, r = [0]
Partial fraction expansion
 residue finds the partial fraction expansion of the ratio of two
polynomials.
 r is a column vector of residues,
 􀃆 p is a column vector of pole locations, and
 􀃆 k is a row vector of direct terms.
 [r,p,k] = residue(b,a)
Partial fraction expansion
 Note: Given three input arguments (r, p, k), residue converts back to
polynomial form.
 [b2,a2] = residue(r,p,k)
 Try this:
Basic analysis data
relation operators
logical operators
 The output of these operators is Boolean.
 1= True.
 0= False.
 Operators are:
logical operators
 The logical operators AND & OR can be
 represented by symbols or functional form
 operators
 >>a=1; b=0;
Examples
Examples
plotting two vectors

More Related Content

What's hot

Intro to Matlab programming
Intro to Matlab programmingIntro to Matlab programming
Intro to Matlab programmingAhmed Moawad
 
Matlab practice
Matlab practiceMatlab practice
Matlab practiceZunAib Ali
 
Introduction to matlab lecture 4 of 4
Introduction to matlab lecture 4 of 4Introduction to matlab lecture 4 of 4
Introduction to matlab lecture 4 of 4Randa Elanwar
 
Matlab matrices and arrays
Matlab matrices and arraysMatlab matrices and arrays
Matlab matrices and arraysAmeen San
 
Matlab Functions
Matlab FunctionsMatlab Functions
Matlab FunctionsUmer Azeem
 
Introduction to MatLab programming
Introduction to MatLab programmingIntroduction to MatLab programming
Introduction to MatLab programmingDamian T. Gordon
 
MATLAB for Technical Computing
MATLAB for Technical ComputingMATLAB for Technical Computing
MATLAB for Technical ComputingNaveed Rehman
 
Matlab solved problems
Matlab solved problemsMatlab solved problems
Matlab solved problemsMake Mannan
 
Matlab 1(operations on_matrix)
Matlab 1(operations on_matrix)Matlab 1(operations on_matrix)
Matlab 1(operations on_matrix)harman kaur
 
Importance of matlab
Importance of matlabImportance of matlab
Importance of matlabkrajeshk1980
 
B61301007 matlab documentation
B61301007 matlab documentationB61301007 matlab documentation
B61301007 matlab documentationManchireddy Reddy
 
MATLAB - The Need to Know Basics
MATLAB - The Need to Know BasicsMATLAB - The Need to Know Basics
MATLAB - The Need to Know BasicsSTEM Course Prep
 

What's hot (20)

Intro to Matlab programming
Intro to Matlab programmingIntro to Matlab programming
Intro to Matlab programming
 
Matlab practice
Matlab practiceMatlab practice
Matlab practice
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
Introduction to matlab lecture 4 of 4
Introduction to matlab lecture 4 of 4Introduction to matlab lecture 4 of 4
Introduction to matlab lecture 4 of 4
 
Matlab matrices and arrays
Matlab matrices and arraysMatlab matrices and arrays
Matlab matrices and arrays
 
Matlab Functions
Matlab FunctionsMatlab Functions
Matlab Functions
 
Introduction to MatLab programming
Introduction to MatLab programmingIntroduction to MatLab programming
Introduction to MatLab programming
 
matlab
matlabmatlab
matlab
 
MATLAB for Technical Computing
MATLAB for Technical ComputingMATLAB for Technical Computing
MATLAB for Technical Computing
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Matlab lec1
Matlab lec1Matlab lec1
Matlab lec1
 
Matlab solved problems
Matlab solved problemsMatlab solved problems
Matlab solved problems
 
Matlab 1(operations on_matrix)
Matlab 1(operations on_matrix)Matlab 1(operations on_matrix)
Matlab 1(operations on_matrix)
 
Intro to matlab
Intro to matlabIntro to matlab
Intro to matlab
 
Importance of matlab
Importance of matlabImportance of matlab
Importance of matlab
 
Matlab1
Matlab1Matlab1
Matlab1
 
B61301007 matlab documentation
B61301007 matlab documentationB61301007 matlab documentation
B61301007 matlab documentation
 
MATLAB - The Need to Know Basics
MATLAB - The Need to Know BasicsMATLAB - The Need to Know Basics
MATLAB - The Need to Know Basics
 
Matlab commands
Matlab commandsMatlab commands
Matlab commands
 

Viewers also liked

Mobile-First SEO - The Marketers Edition #3XEDigital
Mobile-First SEO - The Marketers Edition #3XEDigitalMobile-First SEO - The Marketers Edition #3XEDigital
Mobile-First SEO - The Marketers Edition #3XEDigitalAleyda Solís
 
Webinar - Creating Engaging eLearning for Complex Technical Topics in the Fin...
Webinar - Creating Engaging eLearning for Complex Technical Topics in the Fin...Webinar - Creating Engaging eLearning for Complex Technical Topics in the Fin...
Webinar - Creating Engaging eLearning for Complex Technical Topics in the Fin...Raptivity
 
A framework for Semantic Content Analysis in the context of L'Aquila Social U...
A framework for Semantic Content Analysis in the context of L'Aquila Social U...A framework for Semantic Content Analysis in the context of L'Aquila Social U...
A framework for Semantic Content Analysis in the context of L'Aquila Social U...Cataldo Musto
 
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingAgile Testing Alliance
 

Viewers also liked (20)

Robotics lecture 3
Robotics lecture 3Robotics lecture 3
Robotics lecture 3
 
Where are things in 3 d
Where are things in 3 dWhere are things in 3 d
Where are things in 3 d
 
Where are things in 2 d
Where are things in 2 dWhere are things in 2 d
Where are things in 2 d
 
Automation lecture 2
Automation lecture 2Automation lecture 2
Automation lecture 2
 
Forward kinematics
Forward kinematicsForward kinematics
Forward kinematics
 
Automation lecture 6
Automation lecture 6Automation lecture 6
Automation lecture 6
 
Dh parameters robotics
Dh  parameters roboticsDh  parameters robotics
Dh parameters robotics
 
Automation lecture5
Automation lecture5Automation lecture5
Automation lecture5
 
Robotics lec 5
Robotics lec 5Robotics lec 5
Robotics lec 5
 
Robotics lec 6
Robotics lec 6Robotics lec 6
Robotics lec 6
 
Automation lec4
Automation lec4Automation lec4
Automation lec4
 
Robotics lec7
Robotics lec7Robotics lec7
Robotics lec7
 
Sensors
SensorsSensors
Sensors
 
Automation lec3
Automation lec3Automation lec3
Automation lec3
 
Mobile-First SEO - The Marketers Edition #3XEDigital
Mobile-First SEO - The Marketers Edition #3XEDigitalMobile-First SEO - The Marketers Edition #3XEDigital
Mobile-First SEO - The Marketers Edition #3XEDigital
 
Webinar - Creating Engaging eLearning for Complex Technical Topics in the Fin...
Webinar - Creating Engaging eLearning for Complex Technical Topics in the Fin...Webinar - Creating Engaging eLearning for Complex Technical Topics in the Fin...
Webinar - Creating Engaging eLearning for Complex Technical Topics in the Fin...
 
Nework meet-up
Nework meet-upNework meet-up
Nework meet-up
 
A framework for Semantic Content Analysis in the context of L'Aquila Social U...
A framework for Semantic Content Analysis in the context of L'Aquila Social U...A framework for Semantic Content Analysis in the context of L'Aquila Social U...
A framework for Semantic Content Analysis in the context of L'Aquila Social U...
 
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
 
Automation lec4
Automation lec4Automation lec4
Automation lec4
 

Similar to Lecture three

Digital communication lab lectures
Digital communication lab  lecturesDigital communication lab  lectures
Digital communication lab lecturesmarwaeng
 
A complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsA complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsMukesh Kumar
 
Intro to MATLAB and K-mean algorithm
Intro to MATLAB and K-mean algorithmIntro to MATLAB and K-mean algorithm
Intro to MATLAB and K-mean algorithmkhalid Shah
 
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulinkMATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulinkreddyprasad reddyvari
 
COMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptxCOMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptximman gwu
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlabDnyanesh Patil
 
Introduction to Matlab.pdf
Introduction to Matlab.pdfIntroduction to Matlab.pdf
Introduction to Matlab.pdfssuser43b38e
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlabBilawalBaloch1
 

Similar to Lecture three (20)

Digital communication lab lectures
Digital communication lab  lecturesDigital communication lab  lectures
Digital communication lab lectures
 
A complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsA complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projects
 
Intro to MATLAB and K-mean algorithm
Intro to MATLAB and K-mean algorithmIntro to MATLAB and K-mean algorithm
Intro to MATLAB and K-mean algorithm
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
Matlab intro
Matlab introMatlab intro
Matlab intro
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
Matlab polynomials
Matlab polynomialsMatlab polynomials
Matlab polynomials
 
presentation.pptx
presentation.pptxpresentation.pptx
presentation.pptx
 
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulinkMATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
 
Matlab booklet
Matlab bookletMatlab booklet
Matlab booklet
 
EPE821_Lecture3.pptx
EPE821_Lecture3.pptxEPE821_Lecture3.pptx
EPE821_Lecture3.pptx
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
COMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptxCOMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptx
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Introduction to Matlab.pdf
Introduction to Matlab.pdfIntroduction to Matlab.pdf
Introduction to Matlab.pdf
 
Matlab variables
Matlab variablesMatlab variables
Matlab variables
 
Matlab algebra
Matlab algebraMatlab algebra
Matlab algebra
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 

More from Mahmoud Hussein

More from Mahmoud Hussein (20)

07 modelling.electric.motors
07 modelling.electric.motors07 modelling.electric.motors
07 modelling.electric.motors
 
Dc dc converter
Dc dc converterDc dc converter
Dc dc converter
 
08 pid.controller
08 pid.controller08 pid.controller
08 pid.controller
 
06 control.systems
06 control.systems06 control.systems
06 control.systems
 
05 tuning.pid.controllers
05 tuning.pid.controllers05 tuning.pid.controllers
05 tuning.pid.controllers
 
02 physical.system.modelling mechanical.systems.
02 physical.system.modelling mechanical.systems.02 physical.system.modelling mechanical.systems.
02 physical.system.modelling mechanical.systems.
 
03 dynamic.system.
03 dynamic.system.03 dynamic.system.
03 dynamic.system.
 
Lecture 02 laplace transformation
Lecture 02 laplace transformationLecture 02 laplace transformation
Lecture 02 laplace transformation
 
Model based design-Hardware in loop-software in loop
Model based design-Hardware in loop-software in loopModel based design-Hardware in loop-software in loop
Model based design-Hardware in loop-software in loop
 
Ac drive basics
Ac drive basicsAc drive basics
Ac drive basics
 
Velocity kinematics
Velocity kinematicsVelocity kinematics
Velocity kinematics
 
MPI Communication
MPI CommunicationMPI Communication
MPI Communication
 
ERROR
ERRORERROR
ERROR
 
Analogue Module
Analogue ModuleAnalogue Module
Analogue Module
 
Function Block & Organization Block
Function Block & Organization BlockFunction Block & Organization Block
Function Block & Organization Block
 
Data Block
Data BlockData Block
Data Block
 
Declaration Table
Declaration TableDeclaration Table
Declaration Table
 
Math operation
Math operationMath operation
Math operation
 
Industrial communication
Industrial communicationIndustrial communication
Industrial communication
 
Computer vision
Computer visionComputer vision
Computer vision
 

Recently uploaded

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 

Recently uploaded (20)

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 

Lecture three

  • 3. Solving linear equation  Suppose that you would like to solve the following system of equations:  2X+Y-Z=6  X-Y-Z=-3  X+2Y-3Z=-9  In matrix form, you can write:
  • 5. Quiz • Write a vector start from zero and increment with 5 and end with 43. • Write a vector with the following sequence[1 3 5 7 9 13 17 21 -2 -5 -7 -9] • Create a vector and sort it. • Create matrix [1 2 3;4 5 6;7 9 8] and delete second row. • Solve the following equations  2X+Y-Z=6  X-Y-Z=-3  X+2Y-3Z=-9  Write a vector [1 2 3] and get the transpose.
  • 6. Curve fitting  Given a set of Inputs and outputs for a particular system; MATLAB can find a polynomial function the fit the output to input.  This is done using the polyfit instruction.  p = polyfit(x,y,n) 􀃆 finds the coefficients of a polynomial p(x) of degree n that fits the data, p(x(i)) to y(i), in a least squares sense.
  • 7. Curve fitting  Polynomial evaluation. y = polyval(p,x) Returns the value of a polynomial of degree n evaluated at x. The input argument p is a vector of length n+1 whose elements are the coefficients in descending powers of the polynomial to be evaluated.
  • 8. Curve fitting  Polynomial evaluation.􀃆 Example:
  • 10. Curve fitting  Graphical comparison >>month=1:1:12;  >>temp=[17 19 22 24 27 30 34 35 31 26 23 20];  >>n=2;  >>p=polyfit(month,temp,n);  >>x=1:0.1:12;  >>y=polyval(p,x);  >>plot(month,temp,’r’,x,y,’g’)
  • 12. M-Files • Text files containing MATLAB code. • Useful for complex tasks.  we can store the typed input into a file and  tell MATLAB to get its input from that file.  Extension: .m  We can put comments on program to improve program quality and enable to another programmer to edit.
  • 13. M-Files  If an m-􀃆le contains MATLAB statements just as you would type them into MATLAB, theyare called scripts.  M-􀃆les can also accept input and produce output, in which case they are called functions.  The MATLAB executes the instructions, just as if you had typed them in the command window.
  • 14. Polynomials  Sometimes you need to: Write a polynomial, Find its roots, Multiply it by another one, Divide it by another polynomial, Differentiate it, Integrate it, Substitute by a value in it, or Put it in partial fractions form.
  • 15. Polynomials  MATLAB provides us with a complete set to handle polynomials.  Polynomials are identified by their coefficients or by its roots.  N th order polynomial is defined by a row array of length N+1 containing the coefficients of the polynomial ordered by descending powers.  Example:  p = [1 0 -2 -5];
  • 18. Convolution and deconvolution  Polynomial multiplication 􀃆convolution  Polynomial division 􀃆deconvolution.  Example:  C = conv(a,b) a*b (a,b are polynomials)  􀃆 [Z,r] = deconv(C,a) Z = C/a = b, r = [0]
  • 19. Partial fraction expansion  residue finds the partial fraction expansion of the ratio of two polynomials.  r is a column vector of residues,  􀃆 p is a column vector of pole locations, and  􀃆 k is a row vector of direct terms.  [r,p,k] = residue(b,a)
  • 20. Partial fraction expansion  Note: Given three input arguments (r, p, k), residue converts back to polynomial form.  [b2,a2] = residue(r,p,k)  Try this:
  • 23. logical operators  The output of these operators is Boolean.  1= True.  0= False.  Operators are:
  • 24. logical operators  The logical operators AND & OR can be  represented by symbols or functional form  operators  >>a=1; b=0;