Mathematics and Computation Flashcards

(60 cards)

1
Q

What is a matrix with only one dimension?

A

a vector

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a matrix?

A

a 2d array of numbers
m(rows) X n(columns)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you find an element within a matrix?

A

element denoted by A¬ij where i is the row and j is the column

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you enter row and columns is matlab?

A

use commas for rows and semi colons for columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you access a matrix element in matlab?

A

A(i, j) returns A¬ij

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you access the whole row or column in matlab?

A

use a colon in place of row or column

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you access part of a matrix row or column in matlab?

A

use X:Y, shows numbers X to Y (inclusive)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you find how many rows or columns a matrix has in matlab?

A

size(M) shows both
size(M, 1) shows rows
size(M, 2) shows columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you add matrices?

A

they have to be the same size and just add the numbers that are in the same spot

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you subtract matrices?

A

matrices have to be the same size and just subtract the numbers that are in the same spot

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you do scalar multiplication of matrices?

A

multiply each of the elements by the scalar value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does transposing a matrix do?

A

flips the matrix diagonally
m x n -> n x m

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you transpose a matrix in matlab?

A

Transpose(A)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a diagonal matrix?

A

the elements where the row and column are the same and the rest are zeros

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the trace of a matrix?

A

the sum of all the elements on the diagonal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you trace in matlab?

A

trace(A)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How do you make a zero matrix in matlab?

A

zeros(m, n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is an identity matrix?

A

a diagonal matrix containing only 1’s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How do you make an identity matrix in matlab?

A

eye(n) == n x n identity matrix

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How can a matrix be symmetric?

A

when A = Transpose(A)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How can a matrix be skew symmetric?

A

when A = -Transpose(A)
only happen when diagonal elements are 0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is a triangular matrix?

A

when all the elements are 0 above(lower) or below(upper) the diagonal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

How do you divide a matrix?

A

multiply by the reciprocal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What does sum() do in matlab?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What does prod() do in matlab?
if the matrix is a vector it will multiply all the elements, if it is a matrix it will multiply the values of each column
26
What does mean() do in matlab?
if the matrix is a vector it will mean all the elements, if it is a matrix it will mean the values of each column
27
What does sqrt() do in matlab?
it square roots each of the values in the matrix
28
What does "." mean in matlab?
means to process each element of the matrix independently of the others
29
What does plot(X, Y) mean in matlab?
it plots a line using the coordinates in X and Y
30
How do you put multiple lines on one graph?
Either put it in one plot function or type "hold on" to add it to the same graph, type "hold off" to stop
31
How to do element wise operations in matlab?
put a "." and then the operation
32
What is the condition of matrix multiplication?
the number of columns in the first must equal the number of rows in the other
33
What will the rows and columns be after matrix manipulation?
the rows of the first one and the columns of the other
34
What is the product of transpose(AB) equal?
transpose(B) x transpose(A)
35
How do you denote vectors?
usig a bold lower case letter
36
What does diag() do in matlab?
makes a column vector of the diagonal element of a matrix
37
How do you solve simultaneous equations using matrices?
put into form [ numbers ] [ x = [ ans ] y ] then times by matrix that when times by the numbers it creates a 0 on the bottom left and top right
38
How do you solve simultaneous equations using magic matrix in matlab?
mA = M*A; mb = M*b mb./diag(mA)
39
How do you scale using matrix multiplication?
add 1s to the bottom of the matrix to make it a 3xn matrix then times by [ Sx 0 0 0 Sy 0 0 0 0 ]
40
How do you rotate using matrix multiplication?
add 1s to the bottom of the matrix to make it a 3xn matrix then times by [ cosx -sinx 0 sinx cosx 0 0 0 0 ]
41
How do you translate using matrix multiplication?
add 1s to the bottom of the matrix to make it a 3xn matrix then times by [ 1 0 Tx 0 1 Ty 0 0 1 ]
42
How do you combine scale and rotation in matrix multiplication?
times them together right to left
43
How do you define the coordinates of a shape in matlab?
start at one point and go round until you input the first one again
44
How do you change the base of a log?
log a (X) = (log b (X) / log b (a))
45
What is a sigmoid function?
a smooth transition from 0 to 1
46
What is a tanh function?
smooth transition from -1 to 1
47
How can a phase shifted sinusoid be expressed using sin and cos?
Ksin(ωt + 𝜙) = Ksin(ωt)cos(𝜙) + Kcos(ωt)sin(𝜙)
48
How do you find 𝜙 of phase shifted sinusoid?
if x = 0 and y > 0 𝜙 = π/2 if x = 0 and y < 0 𝜙 = -π/2 if x > 0 𝜙 = arctan(y/x) if x < 0 and y ≥ 0 𝜙 = arctan(y/x)+π if x < 0 and y < 0, 𝜙 = arctan(y/x) − π
49
How do you create a variable that increments in matlab?
starting value: increment: end value
50
How can you have many graphs on one figure in matlab?
use subplot(x,y, p) x and y is how many on x and y axis then p is the position reading like a book
51
How do you use multiple figures in matlab?
figure(number)
52
How do you differentiate polynomials in matlab?
polyder(coefficients to the equation)
53
How do you intergrate in matlab?
polyint(coefficients to the equation)
54
How do you evaluate a polynomial in matlab?
polyval(polynomial coefficients, number entered)
55
What is the inverse of matrix A?
the adjoint of A / the determinant of A
56
How do you find the cofactor?
cross out the row and column of that cofactor and is it positive if i+j is even and opposite
57
How do you find the determinant of a matrix?
a11C11 + a12C12 and so on
58
How do you find the adjoint of a matrix?
Transpose[c11, c12;c21, c22]
59
What is Cramer's rule?
find variables of [x1;x2;...] xk = Dk/D where Dk is the determinants of D where the kth column is replaced by b
60
How do you find the inverse of a diagonal matrix?
1 over values in the diagonal