An interactive introduction to MATLAB

(Jeff_L) #1
C.4decision making 89

c.4 Decision Making



  1. Relational & Logical operators
    The following were the daily maximum temperatures (◦C) in Washington
    DC during the month of April 2002: 14, 23, 23, 12, 10, 9, 13, 23, 23, 19,
    21, 17, 23, 28, 29, 33, 34, 32, 33, 27, 15, 21, 13, 18, 17, 19, 18, 23, 17, 21.
    Write a script, and use relational and logical operators to determine the
    following:
    a) The number of days the temperature was above 24 ◦C.
    b) The number of days the temperature was between 18 ◦Cand 27 ◦C.

Free download pdf