Question

The global temperature of the planet was recorded every week for 5 years. That makes 52*5...

The global temperature of the planet was recorded every week for 5 years. That makes 52*5 = 260 temperatures. Write an algorithm having: - as a parameter, the list of real values corresponding to the 260 temperatures in the order of recording: 1st week of the 1st year, 2nd week of the 1st year, ..., 52nd week of the 1st year, 1st week of the 2nd year, 2nd week of the 2nd year, ..., 52nd week of the 5th year ; - as a result, the list of the 5 average temperatures of each year (i.e., the list of real temperatures constituted by of the average of the first 52 values, then the average of the next 52 values, and so on).

Homework Answers

Answer #1

Required Matlab code with explanatory comments is given below:

function avg=Q_myavg(A)
avg=zeros(1,5); %initialize averages array
for k=1:5 %for each year
    avg(k)=mean(A(52*(k-1)+1:52*k)); %find the average of each year
end
end

Sample usage:

Hope this was helpful. Please do leave a positive rating if you liked this answer. Thanks and have a good day!

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Asia’s e-commerce landscape has been booming in recent years. The swift adoption of smartphones and greater...
Asia’s e-commerce landscape has been booming in recent years. The swift adoption of smartphones and greater access to the internet has allowed consumers in the region to be a major force in the global digital economy. The expansion looks set to continue at a rapid pace. According to a November 2018 report by Fitch Solutions, e-commerce sales in the region are forecast to increase by 14.2% this year, with an estimated average annual increase of 14% over the medium term...
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation....
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation. case:    W17400 APIGEE: PEOPLE MANAGEMENT PRACTICES AND THE CHALLENGE OF GROWTH Ranjeet Nambudiri, S. Ramnarayan, and Catherine Xavier wrote this case solely to provide material for class discussion. The authors do not intend to illustrate either effective or ineffective handling of a managerial situation. The authors may have disguised certain names and other identifying information to protect confidentiality. This publication may not be...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...