Page 27 - MATLAB an introduction with applications
P. 27
12 ——— MATLAB: An Introduction with Applications
For example, if A and B are two arrays (2 × 3 matrices).
a a a b b b
A = 11 12 13 and B = 11 12 13
a 21 a 22 a 23 b 21 b 22 b 23
Then, the matrix addition (A + B) is obtained by adding A and B is
a + b 11 a 12 + b 12 a + b
11
13
13
a 21 + b 21 a 22 + b 22 a 23 + b 23
1.10.2 Dot Product
The dot product is a scalar computed from two vectors of the same size. The scalar is the sum of the products
of the values in corresponding positions in the vectors.
For n elements in the vectors A and B:
n
dot product = A * B = ∑ ab
ii
i= 1
dot(A, B): Computes the dot product of A and B. If A and B are matrices, the dot product is a row vector
containing the dot products for the corresponding columns of A and B.
1.10.3 Array Multiplication
The value in position c of the product C of two matrices, A and B, is the dot product of row i of the first matrix
i,j
and column of the second matrix.
n
=
c , ij ∑ a , i k b , k j
k = 1
1.10.4 Array Division
The division operation can be explained by means of the identity matrix and the inverse matrix operation.
1.10.5 Identity Matrix
An identity matrix is a square matrix in which all the diagonal elements are 1’s, and the remaining elements are
0’s. If a matrix A is square, then it can be multiplied by the identity matrix, I, from the left or from the right:
AI = IA = A
1.10.6 Inverse of a Matrix
The matrix B is the inverse of the matrix A when the two matrices are multiplied and the product is an identity
matrix. Both matrices A and B must be square and the order of multiplication can be AB or BA.
AB = BA = I
1.10.7 Transpose
The transpose of a matrix is a new matrix in which the rows of the original matrix are the columns of the new
T
matrix. The transpose of a given matrix A is denoted by A . In MATLAB, the transpose of the matrix A is
denoted by A′.
F:\Final Book\Sanjay\IIIrd Printout\Dt. 10-03-09