Help with Matlab problem please: A meteorologist collects temperature data every
ID: 647037 • Letter: H
Question
Help with Matlab problem please:
A meteorologist collects temperature data every day for the past few years. Here is an example of his data for a month of June, where each individual value reflects the highest temperature on a particular day:
[78,77,80,81,83,82,84,85,90,90,91,92,97,96,99,97,101,99,98,99,96,97,94,90,89,87,88,82,80,78]
The meteorologist needs to know when heat waves occur. He defines heat waves as periods of time where the maximum temperature exceeds 90 degrees Fahrenheit for more than 7 continuous days. Create a function, heat_wave (in the file heat_wave.m), that utilizes a while loop to count how many heat wave events occur in addition to the total number of days that were part of a heat wave. This function should take in a 1-by-n matrix, D, of temperature data (where n can be any positive integer) as its input. The function should output a two element matrix, were the first element reflects the number of heat wave events that occurred within the data set and the second the number of total days that were part of any heat wave.
Create the matrix of temperatures listed above and then run the heat_wave function on that matrix.
Explanation / Answer
%
% DATAGENERATION SECTION
%
matrix = rand(5);
%
% START OF COMPUTATIONAL ALGORITHM
%
temp = matrix;
%
% FINALIZATION, MEMORY DEALLOCATION
%
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.