Matlab - colon Flashcards

1
Q

what does a colon mean when you use it in round brackets

A

it means everything in a row or column and is normally used to extract data from a matrix

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

what would E( : , 2 ) mean

A

everything in COLUMN 2 of E

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

if the matrix is

E = 1 2 10
4 5 6
7 8 9

what would
» E(:,2) print?

A

ans = 2
5
8

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

what would E(2,:) mean?

A

every column in ROW 2 of E

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

if the matrix is
E = 1 2 10
4 5 6
7 8 9

what would&raquo_space; E(2,:) print?

A

ans = 4 5 6

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

what does this mean E(:)

A

it would rearrange everything in E into one long column

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

what does a colon mean between two numbers

A

it means to count from A to B one integer at a time

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

what would this command print?

F = 5:10

A

F = 5 6 7 8 9 10

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

what does this mean F(:,3:5)

A

from matrix F, everything in columns 3, 4 and 5

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

what does a set of three numbers mean when using two colons? example: G = 3:4:20

A

the middle number specifies in what increments to count from A to B.

from example: ans = 3 7 11 15 19

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