How to calculate hourly observation?

1 view (last 30 days)
aa
aa on 12 Dec 2020
Commented: aa on 13 Dec 2020
Hi everyone,
May someone help me here ...
I have data in two columns, Hour and Minuts. I have to calculate the hourly number of observation. For example, observation among 17:30 to 18:30 and then 19:30 and so on. It's not fixed something 19:42 to 20:42 and so on for a period of 2 days. I have attached data here.

Accepted Answer

KSSV
KSSV on 12 Dec 2020
You can use interp1 to get what you want.
  1. Read the excel file.
  2. To read the exel file use readtable.
  3. Convert your time into date time. Read about datetime.
  4. Create your required hourly time data.
  5. Then use interp1.
  1 Comment
aa
aa on 13 Dec 2020
I have attempted with this but unable to implement. Let me explain you in more detail about what i required.
I have one set of data in YYYY:MM:DD:HH:MM:SS. It is varibale data points per hour and length of the aray is varies from few tens to thousands. While the other data set has only one value (in YYYY:MM:DD:HH:MM:SS). I want to get hourly number of observations in data set one for 48 hours after the time values of second data set. For example, if the value of data set 2 is 2015:02:12:19:30:00, I need to get observation per hour from 2015:02:12:19:30 to 2015:02:14:19:30. Both data set attached here.

Sign in to comment.

More Answers (0)

Categories

Find more on Dates and Time in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!