SlideShare une entreprise Scribd logo
1  sur  27
Introduction to  Matlab  By Abd El Kareem Ahmed
Contents ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
MATLAB Environment   Command window Use  Menus  as an alternative to typing some commands  Use of  Toolbar  for easy access to popular operations Status bar Command window Status of Caps, Num, and Scroll locks New M-file Open file Undo New Simulink Model Help Cut Paste Copy Workspace Browser Path Browser
MATLAB Environment   Workspace Open the selected matrix  Delete the selected matrix from the workspace Displays the total number of elements in the workspace and total size of them. Close the workspace browser  size of the matrix  Number of bytes in the matrix Name of the matrix Type of the matrix
MATLAB Environment   Workspace Name of the matrix  Current dimension of  the matrix:  User can change the dimensions of the matrix by simply type the dimensions he/she want  Current Cell  Current values:  User can change the values o the matrix’s element by editing in the cell.
MATLAB Environment   Path browser The current Directory  The directories in the path  The Files in the selected path.  Add a new path  Remove the selected path
MATLAB Environment   Editor window Current line number Automatic Indenting Automatic Color Highlighting to Distinguish Different Elements The toolbar Names of the opened files in the editor New file Save file Copy Print Set/Clear break point Step in Continue  List if functions in call stack  Open file Cut Paste Help Clear  all break points  Single step Quit debugging
MATLAB Environment   Figure window New figure Open an exciting figure  Save the current figure Print  Zoom the plot  Rotate the plot  Start / End the plot editor mode  Draw an arrow in the plot Type a text in the plot Draw a line in the plot
Basic Functions load save lookfor help whos who clear clc Function name Loading  saved workspace Saving  workspace Search for a word in  MATLAB files Show information about any function Show  workspace   in details Show  workspace Clear  workspace Clear the command window Function mean
Variables ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Variables The number of output parameters nargout   The number of input parameters nargin Maximum real number = 10 308 × 1.7977 realmax Minimum real number = 10 -308 × 2.2251 realmin When the result = 0/0 NaN Very large value =  ∞  as the result of (1/0) inf Very small value eps Pi = 3.14 pi  Default function output ans
Arrays : review ,[object Object],[object Object],[object Object],5  4  0  7 0 5 7 1  4  4  5 12  8  9  15 1  0  0 0  1  0 0  0  1 ,[object Object],[object Object],[object Object],(2×4) ->  (3×2) ->  (1×4) ->  (3×1) ->
Arrays : review ,[object Object],[object Object],[object Object],1  3  0  2 5  4  0  7 0  1  4  3 7  4  9  8  1  4  4  5 12  8  9  15 2  6  0  4 10  8  0  14 ,[object Object],[object Object],[object Object],[object Object],ax+by cx+dy ex+fy (m×k)(k×n)=(m×n)  a b c d e f x y
Arrays : Marlab vision 2  3  5  9  1 0  3  6  4  5 1  10  8  6  4 M= ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],a=[1 4 6 8 9]  a=[1,4,6,8,9]  m=[18] a=3*6   m=[4] m=4
0  0  0 0  0  0 0  0  0 0  0  0 0  0  0 1  1  1 1  1  1 1  1  1 1  1  1 1  1  1 1  0  0 0  1  0 0  0  1 1  0  0 0  1  0 8  1  6 3  5  7 4  9  2 0.1389  0.6038  0.0153  0.9318 0.2028  0.2722  0.7468  0.4660   0.1987  0.1988  0.4451  0.4186 magic(3) =  magic logspace (0,4,5)= [1 10 100 1000 10000] logspace (1,2,3)= [10 31.6228 100] logspace linspace  ( 0,4,5 )=  [0 1 2 3 4]  linspace  ( 1,2,3 )=  [1 1.5 2] linspace rand ( 3,4) =  rand eye(3)=  eye(2,3)=  eye ones(3)=  ones(2,3)=  ones zeros(3)=  zeros(2,3)=  zeros Standard arrays
N= 1  0  3 4  7  5 9  2  8 1 7 8 9  2  8 4  7  5 1  0  3 3  0  1 5  7  4 8  2  9 3  5  8 0  7  2 1  4  9 -0.3866  -0.0504  0.1765 -0.1092  0.1597  -0.0588 0.4622  0.0168  -0.0588 1  4  9 0  7  2 3  5  8 find (N ==7 ) = 5  find (N == 10 ) = []  find rot90(N)=  fliplr ( N)= flipud ( N)=   min(N) =  [1  0  3] max(N) = [9  7  8] sum(N) = [14  9  16] rot90 fliplr flipud min max sum transpose ( ´  ) inv diag det length size transpose ( N)= diag(N)= det(N)=-119 length(N)=[3] size(N)=[3 3] Array functions
Relational and Logical Operators logical exclusive or xor logical not ~ not logical or | or logical and & and Logical Operators greater than or equal >= ge less than or equal  <= le greater than  > gt less than < lt not equal ~= ne equal = = eq Comment Symbol Operator name Relational Operators
Control Flow ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Control Flow ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Control Flow ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Control Flow ,[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]
Control Flow ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
M-files ,[object Object],[object Object],[object Object],[object Object],[object Object]
M-files ,[object Object],[object Object],[object Object],[object Object],[object Object]
M-files ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Math functions rem ceil floor round fix Approximation functions sph2cart deg2rad rad2deg base2dec pol2cart cart2pol cart2sph bin2dec hex2dec dec2base dec2bin dec2hex conversion functions tanh sinh cosh acot asec rem ceil floor real imag conj angle abs cos abs complex functions acsc sort cot min sec max csc exp atan log10 asin log acos power tan mean sin sqrt triangular   functions Basic functions
Exercise ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Contenu connexe

Tendances

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)

Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlab
 
MATLAB - Arrays and Matrices
MATLAB - Arrays and MatricesMATLAB - Arrays and Matrices
MATLAB - Arrays and Matrices
 
Matlab Introduction
Matlab IntroductionMatlab Introduction
Matlab Introduction
 
Brief Introduction to Matlab
Brief  Introduction to MatlabBrief  Introduction to Matlab
Brief Introduction to Matlab
 
Matlab matrices and arrays
Matlab matrices and arraysMatlab matrices and arrays
Matlab matrices and arrays
 
Matlab intro
Matlab introMatlab intro
Matlab intro
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlab
 
An Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersAn Introduction to MATLAB for beginners
An Introduction to MATLAB for beginners
 
Matlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingMatlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processing
 
Matlab practical and lab session
Matlab practical and lab sessionMatlab practical and lab session
Matlab practical and lab session
 
Basics of matlab
Basics of matlabBasics of matlab
Basics of matlab
 
MATLAB Programming
MATLAB Programming MATLAB Programming
MATLAB Programming
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
Matlab1
Matlab1Matlab1
Matlab1
 
Matlab on basic mathematics
Matlab on basic mathematicsMatlab on basic mathematics
Matlab on basic mathematics
 
User defined Functions in MATLAB Part 1
User defined Functions in MATLAB Part 1User defined Functions in MATLAB Part 1
User defined Functions in MATLAB Part 1
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Python programming : Standard Input and Output
Python programming : Standard Input and OutputPython programming : Standard Input and Output
Python programming : Standard Input and Output
 
Matlab m files and scripts
Matlab m files and scriptsMatlab m files and scripts
Matlab m files and scripts
 
Importance of matlab
Importance of matlabImportance of matlab
Importance of matlab
 

Similaire à Learn Matlab

Similaire à Learn Matlab (20)

Es272 ch1
Es272 ch1Es272 ch1
Es272 ch1
 
Programming with matlab session 1
Programming with matlab session 1Programming with matlab session 1
Programming with matlab session 1
 
Matlab ppt
Matlab pptMatlab ppt
Matlab ppt
 
COMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptxCOMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptx
 
Idea for ineractive programming language
Idea for ineractive programming languageIdea for ineractive programming language
Idea for ineractive programming language
 
Introduction to Matlab.pdf
Introduction to Matlab.pdfIntroduction to Matlab.pdf
Introduction to Matlab.pdf
 
bobok
bobokbobok
bobok
 
MATLAB-Introd.ppt
MATLAB-Introd.pptMATLAB-Introd.ppt
MATLAB-Introd.ppt
 
Matlab
MatlabMatlab
Matlab
 
Matlab-1.pptx
Matlab-1.pptxMatlab-1.pptx
Matlab-1.pptx
 
1.1Introduction to matlab.pptx
1.1Introduction to matlab.pptx1.1Introduction to matlab.pptx
1.1Introduction to matlab.pptx
 
INTRODUCTION TO MATLAB session with notes
  INTRODUCTION TO MATLAB   session with  notes  INTRODUCTION TO MATLAB   session with  notes
INTRODUCTION TO MATLAB session with notes
 
R Programming Intro
R Programming IntroR Programming Intro
R Programming Intro
 
mat lab introduction and basics to learn
mat lab introduction and basics to learnmat lab introduction and basics to learn
mat lab introduction and basics to learn
 
Python High Level Functions_Ch 11.ppt
Python High Level Functions_Ch 11.pptPython High Level Functions_Ch 11.ppt
Python High Level Functions_Ch 11.ppt
 
Basic concepts in_matlab
Basic concepts in_matlabBasic concepts in_matlab
Basic concepts in_matlab
 
Introduction to matlab lecture 3 of 4
Introduction to matlab lecture 3 of 4Introduction to matlab lecture 3 of 4
Introduction to matlab lecture 3 of 4
 
20100528
2010052820100528
20100528
 
20100528
2010052820100528
20100528
 
Matlab-free course by Mohd Esa
Matlab-free course by Mohd EsaMatlab-free course by Mohd Esa
Matlab-free course by Mohd Esa
 

Dernier

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
SoniaTolstoy
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
fonyou31
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Dernier (20)

Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 

Learn Matlab

  • 1. Introduction to Matlab By Abd El Kareem Ahmed
  • 2.
  • 3. MATLAB Environment Command window Use Menus as an alternative to typing some commands Use of Toolbar for easy access to popular operations Status bar Command window Status of Caps, Num, and Scroll locks New M-file Open file Undo New Simulink Model Help Cut Paste Copy Workspace Browser Path Browser
  • 4. MATLAB Environment Workspace Open the selected matrix Delete the selected matrix from the workspace Displays the total number of elements in the workspace and total size of them. Close the workspace browser size of the matrix Number of bytes in the matrix Name of the matrix Type of the matrix
  • 5. MATLAB Environment Workspace Name of the matrix Current dimension of the matrix: User can change the dimensions of the matrix by simply type the dimensions he/she want Current Cell Current values: User can change the values o the matrix’s element by editing in the cell.
  • 6. MATLAB Environment Path browser The current Directory The directories in the path The Files in the selected path. Add a new path Remove the selected path
  • 7. MATLAB Environment Editor window Current line number Automatic Indenting Automatic Color Highlighting to Distinguish Different Elements The toolbar Names of the opened files in the editor New file Save file Copy Print Set/Clear break point Step in Continue List if functions in call stack Open file Cut Paste Help Clear all break points Single step Quit debugging
  • 8. MATLAB Environment Figure window New figure Open an exciting figure Save the current figure Print Zoom the plot Rotate the plot Start / End the plot editor mode Draw an arrow in the plot Type a text in the plot Draw a line in the plot
  • 9. Basic Functions load save lookfor help whos who clear clc Function name Loading saved workspace Saving workspace Search for a word in MATLAB files Show information about any function Show workspace in details Show workspace Clear workspace Clear the command window Function mean
  • 10.
  • 11. Variables The number of output parameters nargout The number of input parameters nargin Maximum real number = 10 308 × 1.7977 realmax Minimum real number = 10 -308 × 2.2251 realmin When the result = 0/0 NaN Very large value = ∞ as the result of (1/0) inf Very small value eps Pi = 3.14 pi Default function output ans
  • 12.
  • 13.
  • 14.
  • 15. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 1 1 0 0 0 1 0 8 1 6 3 5 7 4 9 2 0.1389 0.6038 0.0153 0.9318 0.2028 0.2722 0.7468 0.4660 0.1987 0.1988 0.4451 0.4186 magic(3) = magic logspace (0,4,5)= [1 10 100 1000 10000] logspace (1,2,3)= [10 31.6228 100] logspace linspace ( 0,4,5 )= [0 1 2 3 4] linspace ( 1,2,3 )= [1 1.5 2] linspace rand ( 3,4) = rand eye(3)= eye(2,3)= eye ones(3)= ones(2,3)= ones zeros(3)= zeros(2,3)= zeros Standard arrays
  • 16. N= 1 0 3 4 7 5 9 2 8 1 7 8 9 2 8 4 7 5 1 0 3 3 0 1 5 7 4 8 2 9 3 5 8 0 7 2 1 4 9 -0.3866 -0.0504 0.1765 -0.1092 0.1597 -0.0588 0.4622 0.0168 -0.0588 1 4 9 0 7 2 3 5 8 find (N ==7 ) = 5 find (N == 10 ) = [] find rot90(N)= fliplr ( N)= flipud ( N)= min(N) = [1 0 3] max(N) = [9 7 8] sum(N) = [14 9 16] rot90 fliplr flipud min max sum transpose ( ´ ) inv diag det length size transpose ( N)= diag(N)= det(N)=-119 length(N)=[3] size(N)=[3 3] Array functions
  • 17. Relational and Logical Operators logical exclusive or xor logical not ~ not logical or | or logical and & and Logical Operators greater than or equal >= ge less than or equal <= le greater than > gt less than < lt not equal ~= ne equal = = eq Comment Symbol Operator name Relational Operators
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. Math functions rem ceil floor round fix Approximation functions sph2cart deg2rad rad2deg base2dec pol2cart cart2pol cart2sph bin2dec hex2dec dec2base dec2bin dec2hex conversion functions tanh sinh cosh acot asec rem ceil floor real imag conj angle abs cos abs complex functions acsc sort cot min sec max csc exp atan log10 asin log acos power tan mean sin sqrt triangular functions Basic functions
  • 27.