Extracting data from table hourly wise

I am trying to calculate an average of a paramter for a particular hour in a day through out the month by reading the data from table.For example, this is my data in a table.
time temperature
01-Jan-2019 01:00:00 23
01-Jan-2019 02:00:00 29
01-Jan-2019 03:00:00 26
' '
' '
' '
31- Jan-2019 01:00:00 18
' '
31- Jan-2019 23:00:00 16
I have to do this for each hour in a day, so that i can get an average value of the temperature for each hour in a month. Output will be 24 temperature values.
I know that i need to store the each hour data for the whole month in a variable and then use the average to find the average value of that paramter for the whole month in that particular hour. But, i am facing difficulties to finding a way to extract that. I have referred many questions, but could not make a working code. Please, kindly help.

 Accepted Answer

Alan Stevens
Alan Stevens on 24 Jun 2020
Edited: Alan Stevens on 24 Jun 2020
Extract the temperatures values from the table as a column vector, then
T = reshape(temperatures,24,31)';
Av = mean(T);

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Products

Release

R2019a

Tags

Community Treasure Hunt

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

Start Hunting!