Calculating with different date times
Hi,
I have one array that contains my speed during running and the corresponding time it was recorded at. Measurements are about every one second.
Then I have a second array that contains my heart rate measurements and the corresponding time they were recorded at. These measurements contain data from about every 6-10 seconds.
This is shown by the exemplary screenshot.
What I am trying to do is divide my speed by heart rate at the corresponding times to get something like ‘performance’. So I need to average the speed of all measurements that were done for one measurement of heart rate. Something like this:
mean(Speed(1:6))/Heartrate(1)
mean(Speed(7:16))/Heartrate(2)
I cannot do this by hand for the amount of data but have problems coming up with code that selects the correct time range to average the speed (the time range that corresponds to every one measurement of heart rate) and then divides these values.
I appreciate your ideas/ help!
PS Sorry for the bad question title, I couldn’t think of a better one :/Hi,
I have one array that contains my speed during running and the corresponding time it was recorded at. Measurements are about every one second.
Then I have a second array that contains my heart rate measurements and the corresponding time they were recorded at. These measurements contain data from about every 6-10 seconds.
This is shown by the exemplary screenshot.
What I am trying to do is divide my speed by heart rate at the corresponding times to get something like ‘performance’. So I need to average the speed of all measurements that were done for one measurement of heart rate. Something like this:
mean(Speed(1:6))/Heartrate(1)
mean(Speed(7:16))/Heartrate(2)
I cannot do this by hand for the amount of data but have problems coming up with code that selects the correct time range to average the speed (the time range that corresponds to every one measurement of heart rate) and then divides these values.
I appreciate your ideas/ help!
PS Sorry for the bad question title, I couldn’t think of a better one :/ Hi,
I have one array that contains my speed during running and the corresponding time it was recorded at. Measurements are about every one second.
Then I have a second array that contains my heart rate measurements and the corresponding time they were recorded at. These measurements contain data from about every 6-10 seconds.
This is shown by the exemplary screenshot.
What I am trying to do is divide my speed by heart rate at the corresponding times to get something like ‘performance’. So I need to average the speed of all measurements that were done for one measurement of heart rate. Something like this:
mean(Speed(1:6))/Heartrate(1)
mean(Speed(7:16))/Heartrate(2)
I cannot do this by hand for the amount of data but have problems coming up with code that selects the correct time range to average the speed (the time range that corresponds to every one measurement of heart rate) and then divides these values.
I appreciate your ideas/ help!
PS Sorry for the bad question title, I couldn’t think of a better one :/ datetime MATLAB Answers — New Questions