Matrix manipulation Flashcards

1
Q

Define matrix A
| 1 2 |
| 3 4 |
| 5 6 |

A

A = [1 2; 3 4; 5 6]

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

Identity matrix of size 3

A

eye(3)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
"Vectorize" elements of a matrix A:
| 1 2 |
| 3 4 |
to
|1|
|2|
|3|
|4|
A

A(:)

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

Transpose matrix A

A

A’

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

Exact inverse of a square martix A

A

inv(A)

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

Generalized inverse of matrix A. Properties?

A

pinv(A)

A may be square or non square or singular. Pseudo-inverse solves for best fit of a solution to inverse problem.

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

Element ‘3’ of matrix A:
| 1 2 |
| 3 4 |
| 5 6 |

A

A(2,1)

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

Element ‘6’ of matrix A:
| 1 2 |
| 3 4 |
| 5 6 |

A

A(3,2)

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

First column of matrix A:
| 1 2 |
| 3 4 |
| 5 6 |

A

A(:,1)

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

Second row of matrix A:
| 1 2 |
| 3 4 |
| 5 6 |

A

A(2,:)

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

First and third row of matrix A:
| 1 2 |
| 3 4 |
| 5 6 |

A

A( [1 3], : )

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

Copy 3rd row to 1st row of matrix A:
| 1 2 |
| 3 4 |
| 5 6 |

A

A( 1, : ) = A ( 3, : )

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

Retrieve number of rows of matrix A.

A

size(A, 1)

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

Retrieve number of columns of matrix A.

A

size(A, 2)

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

Retrieve greater dimension of matrix A.

A

length(A)

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

Retrieve indices of vector v that are greater than 3.

A

find(v > 3)

17
Q

Map matrix A to a matrix of same dimensions but with elements equal to 0 or 1 when A(i,j) is 3 appropriately.

A

A > 3