Mathematics and Computation Flashcards
What is a matrix with only one dimension?
a vector
What is a matrix?
a 2d array of numbers
m(rows) X n(columns)
How do you find an element within a matrix?
element denoted by A¬ij where i is the row and j is the column
How do you enter row and columns is matlab?
use commas for rows and semi colons for columns
How do you access a matrix element in matlab?
A(i, j) returns A¬ij
How do you access the whole row or column in matlab?
use a colon in place of row or column
How do you access part of a matrix row or column in matlab?
use X:Y, shows numbers X to Y (inclusive)
How do you find how many rows or columns a matrix has in matlab?
size(M) shows both
size(M, 1) shows rows
size(M, 2) shows columns
How do you add matrices?
they have to be the same size and just add the numbers that are in the same spot
How do you subtract matrices?
matrices have to be the same size and just subtract the numbers that are in the same spot
How do you do scalar multiplication of matrices?
multiply each of the elements by the scalar value
What does transposing a matrix do?
flips the matrix diagonally
m x n -> n x m
How do you transpose a matrix in matlab?
Transpose(A)
What is a diagonal matrix?
the elements where the row and column are the same and the rest are zeros
What is the trace of a matrix?
the sum of all the elements on the diagonal
How do you trace in matlab?
trace(A)
How do you make a zero matrix in matlab?
zeros(m, n)
What is an identity matrix?
a diagonal matrix containing only 1’s
How do you make an identity matrix in matlab?
eye(n) == n x n identity matrix
How can a matrix be symmetric?
when A = Transpose(A)
How can a matrix be skew symmetric?
when A = -Transpose(A)
only happen when diagonal elements are 0
What is a triangular matrix?
when all the elements are 0 above(lower) or below(upper) the diagonal
How do you divide a matrix?
multiply by the reciprocal
What does sum() do in matlab?
if the matrix is a vector it will add all the elements, if it is a matrix is will sum the values of each column