Download presentation
Presentation is loading. Please wait.
Published byRobert Ford Modified over 8 years ago
1
Goals for today Learn to create, combine, and index arrays Learn to multiply arrays in MATLAB Use matrix multiplication to simulate a real-world problem Thursday, June 30 th, 2016
2
Last time: assignment addition/subtraction multiplication/division exponentiation expression target = expression a + b a - b a*b a/b a^b a b result 3+2 5 order of operations: PEMDAS () ^ * / + -
3
Vectors, matrices, and multi-dimensional arrays columns rows pages
4
Creating arrays A = [5, 2, 1; 3, 2, 7] separate elements on a row with a comma separate rows with a semicolon
5
Special commands for creating arrays eye(n) ones(n, m) zeros(n, m) start:step:end
6
Transpose arrays with the ‘ operator F = A’ AF G = B’ B G
7
Join arrays together with square brackets ABC A D E
8
Think-Pair-Share: Can these arrays be joined? (1) (2)(3)
9
Retrieving parts of an array: “indexing” A(1, 2) row(s) column(s)
10
Retrieving parts of an array: “indexing” A(2, 3)
11
Multiple indices A([1, 2, 3], [2, 3]) rows columns
12
Multiple indices A(:, [2, 3]) shorthand for “all rows”
13
practice… (a) (d) (f) (e) (c) (b)
14
Matrix multiplication
15
Visualizing matrix multiplication
18
3 rows 3 columns 3x3 matrix
19
Multiplying arrays
20
Will they multiply? N
21
Properties of Matrix Multiplication Yes or no?
22
Multiplying rabbits
23
Can you help the rabbits survive longer without becoming overpopulated? What happens to the population over time? What happens when you change the birth rate? What happens when you change the survival rates?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.