SlideShare une entreprise Scribd logo
1  sur  25
Introduction to  Matlab 7 Lesson I
How to connect to you folders ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #
Matlab 7.0.4 - 7.10 ,[object Object],[object Object],Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  Matlab is an interatcive system for numerical computation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Matlab 7.0.4 - 7.10 ,[object Object],Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  ,[object Object],[object Object],[object Object]
Matlab Introduction Window Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  File Structure Variable Editor Commands / Instructions Command History Variables / Structures Try it! Do not be too timid about your actions. All life is an experiment. The more you make, the better! Ralph Waldo Emerson
Variables Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  Rules: ,[object Object],[object Object],[object Object],[object Object],Valid Examples a = 1 speed = 1500 BeamOutput_Type1 = v*Q*v’ name = ’John Smith’ Invalid Examples 2ndvariable = ’yes’ first one = 1 No need to specify the variable type
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Variables Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  By pressing  “w”+↑, the command who is recalled… Why these are arrays???   Every variable is an array!!!
[object Object],[object Object],[object Object],[object Object],[object Object],Variables Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  By pressing  ↑ or ↓, one can recall the previous commands By using the “ ; “  symbol at the end of a command, the execution is performed, but the result is not shown in the command window
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Vectors Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  If everything is an array, what is a vector ??? You should see: Fast help by: >> help linspace
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Vector's Arithmetic Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  Addition/multiplication by constants Dot product of vectors Addition of vectors Your first matrix…    (3,1) ·(1,3) = (3,3) Error!    (1,3)·(1,3) = nothing Element-by-element operations Examples of functions returning  element-by-element operations
[object Object],[object Object],[object Object],[object Object],[object Object],Vector's Arithmetic II Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  (3,1)x(1,3)=(3,3)   Matrix! (1,3)x(3,1)=(1,1) SCALAR (dot product)   ! Never forget the rules for matrix multiplication!
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Arrays/Matrices Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Accessing Elements Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Arithmetic with Matrices Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  Addition/multiplication by constants Addition of matrices Transpose Elimination of columns/lines Product between matrices Square of matrix Square of matrix's elements E i,j  = 2^A i,j Square-root of matrix's elements Square-root of matrix  (try: >> (sqrtm(A))^2) Inverse of A  (equal to: >> inv(A)) Remember: product between matrices is usually not commutative!
[object Object],[object Object],[object Object],[object Object],Matrix Division Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  Two square matrices A divided by B, alternatively mrdevide(A,B)  equivalent to A*inv(B) The two divisions are different, because the product between matrices is not commutative! alternatively mldevide(A,B)  equivalent to inv(B)*A
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Other Ways of Creating Matrices Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Operators for Matrices Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  min(A) = -max(-A) var(A), std(A), …
Exercises ,[object Object],[object Object],[object Object],Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #
[object Object],[object Object],[object Object],Solution of Linear Algebraic Systems Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  Shortcut
Exercises ,[object Object],[object Object],[object Object],Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Structures in Matlab Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  Structures are arrays whose names have dot-separated parts. They can be used to store information of different kinds together in a hierarchical structure.
[object Object],[object Object],Loops in Matlab Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  ,[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Examples of Loops Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  A technique is a trick that works Giancarlo Rota
While Loops in Matlab ,[object Object],[object Object],Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  ,[object Object],[object Object],[object Object],The statement is executed as long as the expression is true The statements are executed an indefinite number of times
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Examples of Loops Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page #  Pre- allocate  arrays Vectorize  and use pre-defined  functions 20 times faster 129 times faster Make it right before you make it faster Elements of Programming Style (1978)

Contenu connexe

Tendances

Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
Santosh V
 
Matlab practical and lab session
Matlab practical and lab sessionMatlab practical and lab session
Matlab practical and lab session
Dr. Krishna Mohbey
 
Basics of matlab
Basics of matlabBasics of matlab
Basics of matlab
Anil Maurya
 

Tendances (20)

Matlab ppt
Matlab pptMatlab ppt
Matlab ppt
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
Matlab
MatlabMatlab
Matlab
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
Matlab intro
Matlab introMatlab intro
Matlab intro
 
Learn Matlab
Learn MatlabLearn Matlab
Learn Matlab
 
Matlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - IMatlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - I
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
MatLab Basic Tutorial On Plotting
MatLab Basic Tutorial On PlottingMatLab Basic Tutorial On Plotting
MatLab Basic Tutorial On Plotting
 
Brief Introduction to Matlab
Brief  Introduction to MatlabBrief  Introduction to Matlab
Brief Introduction to Matlab
 
Libro de MATLAB
Libro de MATLABLibro de MATLAB
Libro de MATLAB
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Matlab practical and lab session
Matlab practical and lab sessionMatlab practical and lab session
Matlab practical and lab session
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlab
 
application based Presentation on matlab simulink & related tools
application based Presentation on matlab simulink & related toolsapplication based Presentation on matlab simulink & related tools
application based Presentation on matlab simulink & related tools
 
Introduction to matlab lecture 1 of 4
Introduction to matlab lecture 1 of 4Introduction to matlab lecture 1 of 4
Introduction to matlab lecture 1 of 4
 
Matlab Introduction
Matlab IntroductionMatlab Introduction
Matlab Introduction
 
Matlab basic and image
Matlab basic and imageMatlab basic and image
Matlab basic and image
 
Basics of matlab
Basics of matlabBasics of matlab
Basics of matlab
 
Advanced MATLAB Tutorial for Engineers & Scientists
Advanced MATLAB Tutorial for Engineers & ScientistsAdvanced MATLAB Tutorial for Engineers & Scientists
Advanced MATLAB Tutorial for Engineers & Scientists
 

En vedette

En vedette (16)

Matlab ppt
Matlab pptMatlab ppt
Matlab ppt
 
Pitfalls In Aspect Mining
Pitfalls In Aspect MiningPitfalls In Aspect Mining
Pitfalls In Aspect Mining
 
Trimble Geo 7 : Introduction
Trimble Geo 7 : IntroductionTrimble Geo 7 : Introduction
Trimble Geo 7 : Introduction
 
Nsm
Nsm Nsm
Nsm
 
Conditional Control in MATLAB Scripts
Conditional Control in MATLAB ScriptsConditional Control in MATLAB Scripts
Conditional Control in MATLAB Scripts
 
NUMERICAL & STATISTICAL METHODS FOR COMPUTER ENGINEERING
NUMERICAL & STATISTICAL METHODS FOR COMPUTER ENGINEERING NUMERICAL & STATISTICAL METHODS FOR COMPUTER ENGINEERING
NUMERICAL & STATISTICAL METHODS FOR COMPUTER ENGINEERING
 
Numerical and statistical methods new
Numerical and statistical methods newNumerical and statistical methods new
Numerical and statistical methods new
 
numericai matmatic matlab uygulamalar ali abdullah
numericai matmatic  matlab  uygulamalar ali abdullahnumericai matmatic  matlab  uygulamalar ali abdullah
numericai matmatic matlab uygulamalar ali abdullah
 
Polynomials and Curve Fitting in MATLAB
Polynomials and Curve Fitting in MATLABPolynomials and Curve Fitting in MATLAB
Polynomials and Curve Fitting in MATLAB
 
Differential equation & laplace transformation with matlab
Differential equation & laplace transformation with matlabDifferential equation & laplace transformation with matlab
Differential equation & laplace transformation with matlab
 
MATLAB : Numerical Differention and Integration
MATLAB : Numerical Differention and IntegrationMATLAB : Numerical Differention and Integration
MATLAB : Numerical Differention and Integration
 
Numerical methods for 2 d heat transfer
Numerical methods for 2 d heat transferNumerical methods for 2 d heat transfer
Numerical methods for 2 d heat transfer
 
Interpolation and extrapolation
Interpolation and extrapolationInterpolation and extrapolation
Interpolation and extrapolation
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlab
 
FDM Numerical solution of Laplace Equation using MATLAB
FDM Numerical solution of Laplace Equation using MATLABFDM Numerical solution of Laplace Equation using MATLAB
FDM Numerical solution of Laplace Equation using MATLAB
 
Guide To Windows 7 - Introduction to Windows 7
Guide To Windows 7 - Introduction to Windows 7Guide To Windows 7 - Introduction to Windows 7
Guide To Windows 7 - Introduction to Windows 7
 

Similaire à Matlab

INTRODUCTION TO MATLAB for PG students.ppt
INTRODUCTION TO MATLAB for PG students.pptINTRODUCTION TO MATLAB for PG students.ppt
INTRODUCTION TO MATLAB for PG students.ppt
Karthik537368
 

Similaire à Matlab (20)

Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Matlab Basic Tutorial
Matlab Basic TutorialMatlab Basic Tutorial
Matlab Basic Tutorial
 
From zero to MATLAB hero: Mastering the basics and beyond
From zero to MATLAB hero: Mastering the basics and beyondFrom zero to MATLAB hero: Mastering the basics and beyond
From zero to MATLAB hero: Mastering the basics and beyond
 
Matlab1
Matlab1Matlab1
Matlab1
 
Matlab Overviiew
Matlab OverviiewMatlab Overviiew
Matlab Overviiew
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
INTRODUCTION TO MATLAB for PG students.ppt
INTRODUCTION TO MATLAB for PG students.pptINTRODUCTION TO MATLAB for PG students.ppt
INTRODUCTION TO MATLAB for PG students.ppt
 
Es272 ch1
Es272 ch1Es272 ch1
Es272 ch1
 
Data Structure & Algorithms - Matrix Multiplication
Data Structure & Algorithms - Matrix MultiplicationData Structure & Algorithms - Matrix Multiplication
Data Structure & Algorithms - Matrix Multiplication
 
Matlab summary
Matlab summaryMatlab summary
Matlab summary
 
Introduction to Matlab.ppt
Introduction to Matlab.pptIntroduction to Matlab.ppt
Introduction to Matlab.ppt
 
gmrit-cse
gmrit-csegmrit-cse
gmrit-cse
 
Matlab anilkumar
Matlab  anilkumarMatlab  anilkumar
Matlab anilkumar
 
MATLAB Workshop yugjjnhhasfhlhhlllhl.pptx
MATLAB Workshop yugjjnhhasfhlhhlllhl.pptxMATLAB Workshop yugjjnhhasfhlhhlllhl.pptx
MATLAB Workshop yugjjnhhasfhlhhlllhl.pptx
 
1.1Introduction to matlab.pptx
1.1Introduction to matlab.pptx1.1Introduction to matlab.pptx
1.1Introduction to matlab.pptx
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
chapter 1
chapter 1chapter 1
chapter 1
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
MATLAB guide
MATLAB guideMATLAB guide
MATLAB guide
 
Raushan's MATLB PPT..pptx
Raushan's MATLB PPT..pptxRaushan's MATLB PPT..pptx
Raushan's MATLB PPT..pptx
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Dernier (20)

Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Matlab

  • 1. Introduction to Matlab 7 Lesson I
  • 2.
  • 3.
  • 4.
  • 5. Matlab Introduction Window Marco Lattuada – Statistical and Numerical Methods for Chemical Engineers Matlab Introduction Course – Page # File Structure Variable Editor Commands / Instructions Command History Variables / Structures Try it! Do not be too timid about your actions. All life is an experiment. The more you make, the better! Ralph Waldo Emerson
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.