Matlab- Round Brackets Flashcards

1
Q

to enter most data in Matlab you need to use

A

brackets []

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

how do you put data into a column vector?

A

type the values in square brackets and separate them by using ;

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

how would the data look like? D = [3; 1; 6; 5]

A

D = 3
1
6
5

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

how do you put data into a matrix?

A

use , to separate the number (rows) and use ; to separate lines (column)

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

how would this look like?
E = [1, 2, 3; 4, 5, 6]

A

E = 1 2 3
4 5 6

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

round brackets () are used for?

A

to refer to a part of a matrix

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

if you used E(2,3) and the matrix was
E = 1 2 3
4 5 6
what would be the output?

A

ans = 6

(explanation: the first number refers to the rows, the second number refers to the columns)

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

what would be the output for this?

E(4,3)
matrix:
E = 1 2 3
4 5 6

A

error message

explanation: it calls for numbers that don’t exist in the matrix.

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

how do you change numbers of a matrix using round brackets

A

In one line: call the matrix, use brackets, in the brackets establish the place in the matrix, use = to replace the number in that location

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

what would the line of code be to change
matrix: E = 1 2 3
4 5 6
to this:
E = 1 2 10
4 5 6

A

E (1,3) = 10

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

how would you change an entire row in a matrix?

A

use round brackets and square brackets

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

how would you add a row or column into a matrix?

A

use round brackets, a colon to call the entire row or column and then = and square brackets to insert the new numbers.

note: the dimensions have to stay the same.

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