ENGRMAE 10 Lecture Notes - Lecture 4: Hayes Command Set, Array Data Structure, Matrix Multiplication
Document Summary
You can enter multiple values into an array by putting brackets around two or more numbers. If you use an array as an argument for a built-in function, the function will act on all elements in the array. There will be times where you will want to perform an operation on all the elements of an array. For example, multiply all the elements of an array by a constant. > a = [2, 3, 9 ; 4, 4, 7] a = * operator instead of just the * operator. > a = a + 1 a = 5 5 8 (we get the same result using . * and * in this case) (a is a 2x3 array) 1 (again, we get the same result using . * and * since 1 is a constant) > a = a . + 1 a =