Module 3 of 8

Arrays and Matrices

5 lessons  ·  Creating arrays, indexing, element-wise and matrix operations

1

Creating arrays

Topics covered

  • Difference between scalars, vectors and matrices
  • Use of colons for vectors and matrices
  • linspace(), logspace(), magic(), rand(), zeros(), ones()
  • Use of square brackets and semi-colons
  • Transposing arrays, fliplr(), flipud()
2

Array indexing

Topics covered

  • Indexing individual elements
  • Indexing rows
  • Indexing columns
  • Indexing groups of elements
  • You cannot index out of bounds
3

Element-wise operations

Topics covered

  • Element-wise operators: .*, ./, .^
  • Visual example of array operations
  • Difference between array and matrix operations
  • Example where both would work (square matrices)
4

Matrix operations

Topics covered

  • Addition/subtraction, transposition, scalar multiplication, matrix multiplication
  • Matrix functions: eye(), inv() or A^-1, det(), cross(), dot(), repmat()
5

Solving a system of linear equations

Topics covered

  • Example on solving a system of linear equations
  • Using the left division operator \ for AX = B