Mock Flashcards
check by giving variable values in command window
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)
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
First part add in script temp_sensors function again:
is_temp_OK(-500,true);
and see message -> see that it’s unrealistic
(: ,1)
means all rows, in first column
equal to original values - 273.1
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)
code to get these
how do you set limits on the axis?
how do get a graph to have dotted points (no continuous line joining points)
matrix multiplication?
*
a
a) return -> go straight to the end of the function
b
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)
c, d, e, f