Mathematics and Computation Flashcards

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
Q

What does prod() do in matlab?

A

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
Q

What does mean() do in matlab?

A

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
Q

What does sqrt() do in matlab?

A

it square roots each of the values in the matrix

28
Q

What does “.” mean in matlab?

A

means to process each element of the matrix independently of the others

29
Q

What does plot(X, Y) mean in matlab?

A

it plots a line using the coordinates in X and Y

30
Q

How do you put multiple lines on one graph?

A

Either put it in one plot function or type “hold on” to add it to the same graph, type “hold off” to stop

31
Q

How to do element wise operations in matlab?

A

put a “.” and then the operation

32
Q

What is the condition of matrix multiplication?

A

the number of columns in the first must equal the number of rows in the other

33
Q

What will the rows and columns be after matrix manipulation?

A

the rows of the first one and the columns of the other

34
Q

What is the product of transpose(AB) equal?

A

transpose(B) x transpose(A)

35
Q

How do you denote vectors?

A

usig a bold lower case letter

36
Q

What does diag() do in matlab?

A

makes a column vector of the diagonal element of a matrix

37
Q

How do you solve simultaneous equations using matrices?

A

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
Q

How do you solve simultaneous equations using magic matrix in matlab?

A

mA = MA; mb = Mb
mb./diag(mA)

39
Q

How do you scale using matrix multiplication?

A

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
Q

How do you rotate using matrix multiplication?

A

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
Q

How do you translate using matrix multiplication?

A

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
Q

How do you combine scale and rotation in matrix multiplication?

A

times them together right to left

43
Q

How do you define the coordinates of a shape in matlab?

A

start at one point and go round until you input the first one again

44
Q

How do you change the base of a log?

A

log a (X) = (log b (X) / log b (a))

45
Q

What is a sigmoid function?

A

a smooth transition from 0 to 1

46
Q

What is a tanh function?

A

smooth transition from -1 to 1

47
Q

How can a phase shifted sinusoid be expressed using sin and cos?

A

Ksin(ωt + 𝜙) = Ksin(ωt)cos(𝜙) + Kcos(ωt)sin(𝜙)

48
Q

How do you find 𝜙 of phase shifted sinusoid?

A

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
Q

How do you create a variable that increments in matlab?

A

starting value: increment: end value

50
Q

How can you have many graphs on one figure in matlab?

A

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
Q

How do you use multiple figures in matlab?

A

figure(number)

52
Q

How do you differentiate polynomials in matlab?

A

polyder(coefficients to the equation)

53
Q

How do you intergrate in matlab?

A

polyint(coefficients to the equation)

54
Q

How do you evaluate a polynomial in matlab?

A

polyval(polynomial coefficients, number entered)

55
Q

What is the inverse of matrix A?

A

the adjoint of A / the determinant of A

56
Q

How do you find the cofactor?

A

cross out the row and column of that cofactor and is it positive if i+j is even and opposite

57
Q

How do you find the determinant of a matrix?

A

a11C11 + a12C12 and so on

58
Q

How do you find the adjoint of a matrix?

A

Transpose[c11, c12;c21, c22]

59
Q

What is Cramer’s rule?

A

find variables of [x1;x2;…]
xk = Dk/D
where Dk is the determinants of D where the kth column is replaced by b

60
Q

How do you find the inverse of a diagonal matrix?

A

1 over values in the diagonal