Skip to main content

more options

Part 2: Using MATLAB     Part 4: Scripts involving simple plots and I/O

Module 1, part 3. Arrays

Contents

No. Topic Discussion
1. Creating arrays   Blecture   pdf This blecture shows you different ways to create vectors and matrices
2. Manipulating arrays
Read Gilat § 2.1 - 2.4
These sections discuss the functions and commands for creating and manipulating arrays.
3. Self-check exercises
Gilat Chapter 2: Problems 4,5,9 (pp. 52-53)
Checklist:
1. Can you create vectors or matrices from a list of known values?
2. Can you create vectors or matrices using functions ones, zeros, and rand?
3. Can you create a vector of values with constant spacing using linspace or a colon expression?
4. Can you transpose a vector or matrix?
4. Array addressing   Blecture   pdf This blecture shows you how to access sub-arrays.
5. More on array manipulation
Read Gilat § 2.6 - 2.9 up to p.49
These sections summarize the syntax for manipulating arrays, including the insertion and deletion of array elements
6. Basic mathematical operations on arrays   Blecture   slides (pdf) This blecture describes simple expressions that perform a mathematical operation on all elements of a vector. Vectorized code is code that performs arithmetic (and relational and logical) operations on multiple elements of an array in one step.
7. Even more vectorized mathematics
Read Gilat § 3.1, 3.4
These sections provide more detail on the syntax and functions for vectorized mathematics. The remaining sections of Chapter 3 involve a branch of mathematics called Linear Algebra, which is not covered in this course. Read those sections if you want to use MATLAB for linear algebra.
8. Self-check exercises
Gilat Chapter 3: Problems 1,2, 14a-c (pp. 79-83)
Do these exercises to check that you know how to work with arrays.