[chronojump] maximumIsometricForce.R at BEST_AVG_RFD_IN_X_MS stop calculating when currentSample + window is grea



commit d37bf1a0ac1c6cd815d56866502108e579b61634
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Aug 4 15:46:57 2022 +0200

    maximumIsometricForce.R at BEST_AVG_RFD_IN_X_MS stop calculating when currentSample + window is greater 
than endSample

 r-scripts/maximumIsometricForce.R | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/r-scripts/maximumIsometricForce.R b/r-scripts/maximumIsometricForce.R
index c2d800282..f20ec324d 100644
--- a/r-scripts/maximumIsometricForce.R
+++ b/r-scripts/maximumIsometricForce.R
@@ -639,6 +639,10 @@ drawDynamicsFromLoadCell <- function(title, exercise, datetime,
                {
                        for (i in dynamics$startSample:dynamics$endSample)
                        {
+                               #stop calculating when currentSample + window is greater than endSample
+                               if (i + window > dynamics$time[dynamics$endSample])
+                                       break()
+
                                forceTemp1 = dynamics$f.raw[i]
                                forceTemp2 = interpolateXAtY(dynamics$f.raw, dynamics$time, dynamics$time[i] 
+ window)
                                RFDtemp = (forceTemp2 - forceTemp1) / window


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]