Mock Flashcards

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

check by giving variable values in command window

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

know to use if, because in Q

check by giving the two variables values in command window and play around with it.

(e.g. variable(21, false) = doesn’t print statement because first if statement goes to end)

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

add is_temp_OK function three times in the temp_sensors script, and give it first input values as the 3 room temps, secondary input values as true

run it to check

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

First part add in script temp_sensors function again:

is_temp_OK(-500,true);
and see message -> see that it’s unrealistic

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

(: ,1)
means all rows, in first column

equal to original values - 273.1

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

get steps - for how long the time will be for
(yk hours is still 240, because 240 rows)

size(variable,1); - gives number of rows (just rows)
size(variable, 2); - gives number of columns

(x-axis) - time = 1: steps;
(1 to all the way to step amount)

h= plot( x1, 1, x1, 2, x1, 3);

e.g. (: , 1); = all rows, only first column

temp against time

exportgraphics (gcf, “name”, “resolution”, 600)

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

code to get these

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

how do you set limits on the axis?

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

how do get a graph to have dotted points (no continuous line joining points)

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

matrix multiplication?

A

*

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

a

A

a) return -> go straight to the end of the function

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

b

A

i = 1:24
hours in a day

time = time +1; (time goes up by 1 hour)

if time >= sim_duration
return;
end

if at some point the time is > sim_duration then finished (return)

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

c, d, e, f

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

very last script task

A

add to temp_sensor script

temperature = simulate_room_temp (18, 240);

17
Q

when should you use:
if-statement:
*for-loop:
*while-loop:
*break:
*return:

A