WK 4 Flashcards

1
Q

Difference between function and scripts

A

Function commands don’t change the workplace, but script does

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

What do matrices need in MATLAB?

A

Square brackets

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

What would be the output?

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

What is X and Y?

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

What do commas and semi-colons do in matrices/vectors?

A

Commas/ spaces separate columns

semi-colons separate rows

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

What would be the input?

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

What would be the output?

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

What would be the input?

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

what is d = a(1,3);

A

(b,c)
where
b = position of row
c = position of column

Get value in first row, third column
Therefore d= 6

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

What is a(1,3) = 60;

A

Set value at first row and third column to 60

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

What is the output?

A

3 = rows
2 = columns

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

What is the output?

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

What is the output?

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

What do colons do?

A

creates loops similar to for-loops

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

What is the output?

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

Give the vector position definitions

A
17
Q

What is the output?

A
18
Q

What is the output?

A
19
Q

What would this create?

A

1) 3 rows, 4 columns of zeroes

2) change values to 7, 8

3) change values to 5

20
Q

Q1

A

Get values of 2nd to 4th row and 2nd column

21
Q

Q2

A

Get values of 1st to 3rd row and all columns

22
Q

Q4

A

Set values of 1st to 3rd row and 2nd column

23
Q

What is
C = [a,b]
D = [a;b]

A
24
Q

What is b’s output?

A
25
Q
A