Question: Create m-file scripts/functions to solve some basic vector problems in MATLAB A. (8 points) We are interested in analyzing weather temperature data for each
Create m-file scripts/functions to solve some basic vector problems in MATLAB A. (8 points) We are interested in analyzing weather temperature data for each day in a month. We have a vector of the low temperature on each day and a corresponding second vector of the high temperature on each day. The first elements in each vector are for the first day of the month, the second elements in each vector are for the second day of the month, etc. Here are two sample vectors you can use, but your code should work for any two vectors of the same length: lows = [59 58 61 62 64 61 49 44 50 50 60 47 41 43 54 65 69 58 53 47 40 38 47 43 42 46 44 43 58 44 44]; highs = [65 67 67 75 82 76 72 66 63 73 76 68 58 68 71 72 85 78 72 60 55 61 73 57 53 51 52 66 73 58 62]; Write a single MATLAB statement to create each result. a. How many days had a high temperature over 75? b. Assign the index of the day of the month with the largest difference between the high and low temperature to the variable maxIndex. c. What is the average low temperature for days when the high temperature was below 70? d. The first day for the above sample vectors are for a Saturday. Find the average high temperature for all Saturdays in the month.
Step by Step Solution
3.42 Rating (158 Votes )
There are 3 Steps involved in it
Heres the MATLAB code to solve the given vector problems Given low and high temperature vectors lows ... View full answer
Get step-by-step solutions from verified subject matter experts
