MATLAB Matrix Manipulation and graphics - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

MATLAB Matrix Manipulation and graphics

Description:

To do an array multiplication both matrices must have the same number of rows AND columns ... useful commands: Hold Grid. Title( ) axis([ , , , ]) Xlabel ... – PowerPoint PPT presentation

Number of Views:96
Avg rating:3.0/5.0
Slides: 9
Provided by: IKU
Category:

less

Transcript and Presenter's Notes

Title: MATLAB Matrix Manipulation and graphics


1
MATLABMatrix Manipulation and graphics
2
Matrix Generation in MATLAB
11 22 33 44 66 55 68 92 35 47 43 46 56 38 97 69
91 46 73 27
66 47 97 27
55 68 92 43 46 56 69 91 46
A
D
C
A 4 3 4 4 6 8 3 6 6 B 35 22 40 C
A(24,13) D A(,end) E A(2, ) F E
E2 G B D
E
55 68 92 35 47
68 59 37 24
66 47 97 27
G
55 68 92 35 47
F
57 70 94 37 49
3
Colon Notation
  • Starting Point Step Ending Point
  • A 1 2 3 4 5 6 7
  • A 17
  • B 1 3 5 7 9 11 13
  • B 1213
  • C 10 9 8 7 6 5
  • C 10 -1 5

4
Common Matrices in MATLAB
  • ones(3,4) All ones (3x4)
  • zeros(2) All zeroes (2x2)
  • eye(3) Identity (3x3)
  • rand(4,5) Random numbers between 0
    and 1 (4x5)
  • magic(4) Dührers matrix (4x4)

5
Array and Matrix Operations
  • A Transpose of Matrix A
  • inv(A) Inverse of Matrix A
  • det(A) Determinant of Matrix A
  • eig(A) Eigenvalues of Matrix A
  • A.A . denotes element by element (array)
    multiplication of A by B. Same approach can be
    used for element by element division and
    exponention.
  • CAUTION To do a matrix multiplication AB, the
    number of columns in A must be equal to the
    number of rows in B
  • To do an array multiplication both matrices must
    have the same number of rows AND columns

6
Size of a Matrix or an Array
7
Solution of Linear Equations
8
Simple Plots
  • Plot(x,y) plots x vs y
  • Plot(x1,y1,x2,y2) Used to show multiple plots in
    the same figure.
  • Subplot(rows,columns,number)
  • Other useful commands
  • Hold Grid
  • Title( ) axis( , , , )
  • Xlabel( ) ylabel( )
  • Type Help plot for details
Write a Comment
User Comments (0)
About PowerShow.com