chapter 10 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

2D array / matrix

A

elements in rows and columns

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

creating a matrix

A

[[row1] ; [row2]]
separate rows by semicolons

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

indexing with coordinate

A

temps(row, column) = 75

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

row-column indexing

A

conventional approach, uses indices to index

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

linear indexing

A

single index used to refer to array element

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

equation for linear indexing

A

m*(y-1) + x

for spot (x,y) and a total of m rows in the matrix

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

out of range indices

A

only resizable with row column indexing, otherwise error

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

integer indexing array

A

section of numbers used to index an array

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

indexing with array

A

weight(1, [1, 2, 3])

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

integer indexing

A

weight(1, 1:3)

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

linear indexing

A

weight([3, 4, 5])

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

flattening an array

A

unwinding a 2D array into column
sampleMatrix(:)

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

array reshaping

A

make 1D array into 2D

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

sampleMatrix(:) = 1

A

makes all the elements 1

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

sampleMatrix(:, 2) = [ ]

A

deletes column 2

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

ciel(x)

A

rounds up to nearest integer greater than or equal to x

17
Q

floor(x)

A

round down to nearest integer less than or equal to x

18
Q

fix(x)

A

round to nearest 0

19
Q

round(x)

A

round to nearest integer (up or down)