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 Chapman § 2.1 - 2.2
These sections discuss the functions and commands for creating and manipulating arrays.
3. Self-check exercise 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 Chapman § 2.3 - 2.4
These sections discuss multidimentsional arrays and acessing sub-arrays.
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 Chapman § 2.8 - 2.9
These sections provide more detail on the syntax and functions for vectorized mathematics.
8. Self-check exercises
Chapman Chapter 2: Problems 2.10,2.12 , this
Do these exercises to check that you know how to work with arrays.