How to calculate the daily and yearly mean of a temperature dataset

6 views (last 30 days)
I have hourly temperature data 1PM October 1 2012 to noon October 1 2017 (exactly 5 years (including a leap day in 2016 (about 45252). I want to the average temperature, the amplitude of the daily temperature (sine component and cosine component) and the amplitude of the yearly temperature (sine component and cosine component) using a for loop. Can anyone give me useful suggestion?

Answers (1)

dpb
dpb on 22 Oct 2022
Read as timetable and then use retime. About 2-3 lines of code each should do it.
  2 Comments
dpb
dpb on 22 Oct 2022
Edited: dpb on 22 Oct 2022
No. NOT "the MATLAB way".
Don't follow the comment/request re: a sine/cosine component, either...not going to produce the requested data values that way.

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!