SlideShare ist ein Scribd-Unternehmen logo
1 von 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)

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 

Kürzlich hochgeladen (20)

The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 

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.