Mathematical Operations with Arrays

Addition and Subtraction

• >>VectA = [8 5 4] ; VectB = [10 2 7]
• >>VectC = VectA + VectB
• VectC = 18 7 11

Element-by- element Operations

Symbol Description
.* Multiplication
./ Right division
.^ Exponentiation
.\ Left division

z = [1:2:15]
z = 1 3 5 7 9 11 13 15

Using Arrays in Matlab Build- in Math

Using Arrays in Matlab Build-in Function

• ndims
• size
• diag
• length
• reshape
• sort
• max, min, mean, median
• ……

Binary Matrix Operations : Vector Multiplication

The dot product

Binary Matrix Operations : Matrix Division

The equations can write in a form

AX = B

Binary Matrix Operations: Matrix Multiplication (2)

Exercise 1

1. Using the element by element
operation and built in function sum to
compute
:

Exercise 2

2. Solve the following system of four linear
equations :

Prev Next