Professional Documents
Culture Documents
Assignment 5
Assignment 5
Logical Functions
Assignment 5a
Question 1
Evaluate the following expressions WITHOUT USING MATLAB first. Then, you
may check the answer with MATLAB.
a) 4 + 5 > 36 / 4
d) 5 x 5 – 4 x 7 < = ~ 2 x 5 – 2 + ~0
e) 0 & 21
g) 4 – 7 / 2 & 6 < 5 | - 3
h) 3 | - 1 & ~ 2 * - 3 | 0
Question 2
The maximum daily temperature (in °C) for Chicago and San Francisco during the
month of August 2009 are given in the vectors below (data taken from the U.S.
National Oceanic and Atmospheric Administration)
TCH = [ 24 25 30 30 26 27 23 32 33 30 27 28 30 31 32 32 28 29 27 26 23
21 23 26 28 22 19 22 21 19 19 ]
TSF = [ 21 20 21 23 22 22 21 24 29 31 23 29 24 20 26 24 20 20 23 22 26
20 20 21 22 21 32 35 32 19 21 ]
Assignment 5b
Question 3
Question 4
Question 5
Question 6
Question 7
Question 8
Question 9