calculate the number of hours for each day meets certain criteria

5 次查看(过去 30 天)
Hi, From an array of 8760 air temperature values, correspond to hourly data of one year. I want to calculate the number of hours for each day (which means for every 24 values of the array) that the temperature is above a certain value, for example 30oC. In addition, it will be nice to have the exact days that meet this criteria in day/month format. Any help will be highly appreciated.
  1 个评论
Adam
Adam 2018-4-9
Use
doc reshape
to reshape to a 24*365 or 365*24 array then you can just use logical operators on the columns or rows
e.g.
temps = reshape( temps, 365, 24 );
above30 = t( t > 30 );
hoursPerDayAbove30 = sum( above30 );

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by