Download ENGR 1181 | MATLAB 3: Array Creation

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Exterior algebra wikipedia , lookup

Cross product wikipedia , lookup

System of linear equations wikipedia , lookup

Eigenvalues and eigenvectors wikipedia , lookup

Cayley–Hamilton theorem wikipedia , lookup

Determinant wikipedia , lookup

Matrix (mathematics) wikipedia , lookup

Laplace–Runge–Lenz vector wikipedia , lookup

Orthogonal matrix wikipedia , lookup

Perron–Frobenius theorem wikipedia , lookup

Non-negative matrix factorization wikipedia , lookup

Vector space wikipedia , lookup

Euclidean vector wikipedia , lookup

Singular-value decomposition wikipedia , lookup

Covariance and contravariance of vectors wikipedia , lookup

Matrix multiplication wikipedia , lookup

Gaussian elimination wikipedia , lookup

Matrix calculus wikipedia , lookup

Four-vector wikipedia , lookup

Transcript
ENGR 1181 | MATLAB 3: Array Creation
In-Class Guide
Learning Objectives
1. Demonstrate proper convention for assigning arrays to a variable. For example,
students will use the following operators/commands to create arrays:
a. Space
b. Semi-colon
c. Colon operator
d. Linspace function
2. Apply the transpose operator correctly
Topics
This lecture contains the following topics:
1. Creating row vectors
2. Creating column vectors
3. Transposing vectors
4. Vectors with constant spacing
5. Matrices: 2-D Arrays
Outline
Below is an outline of the topics and the order in which they should be covered:
1. What is a vector?
a. A vector is an ordered list of several numbers.
b. A one-dimensional array.
c. Likely assign your vector to a variable.
d. Created by typing the elements inside square brackets.
2. Row Vectors (Instructor’s In-class Activity)
a. Horizontal
b. Elements separated by commas OR spaces
3. Column Vectors (Instructor’s In-class Activity)
a. Vertical
b. Elements separated by a semicolon or by an “enter”
4. Row vectors vs. Column vectors (Instructor’s In-class Activity)
a. Need to choose which type to create
b. This will depend on your data and the type of calculations you need to do
c. If you choose the “wrong” type, you can transpose your row vector to a
column vector or a column to a row.
1
ENGR 1181 | Class 3: Array Creation
In-Class Guide
5. Transpose (Instructor’s In-class Activity)
6. Vectors with Constant Spacing (Instructor’s In-class Activity)
a. [first value : spacing : last value]
b. If no spacing value is specified, MATLAB will assign a default value of 1.
c. Linspace(first, last, number)
7. Matrices: 2-D Arrays (Instructor’s In-class Activity)
a. A matrix is a two-dimensional representation of a group of numbers
containing rows and columns
b. Matrix Size:
i. Described by the number of rows and number of columns it has
ii. A (mXn) matrix has “m” rows and “n” columns
c. Creating a matrix.
i. Created by typing the elements row by row inside square brackets
ii. Elements in each row are separated by spaces
iii. To start a new row, use a semicolon or the “Enter” key
8. Have students complete their portion of the in-class activity then start on the
homework. Students will submit their in-class activity to the Carmen dropbox
as a PDF.
2