From c8f02ddceb8fd260ac94f986e8465fef805bdc07 Mon Sep 17 00:00:00 2001 From: Thomas Lambert <t.lambert@uliege.be> Date: Wed, 7 Dec 2022 17:18:26 +0100 Subject: [PATCH] fix(sync): cleanup extrap values --- utils/syncdata.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/syncdata.m b/utils/syncdata.m index d6a09bf..05dccc0 100644 --- a/utils/syncdata.m +++ b/utils/syncdata.m @@ -49,9 +49,11 @@ function [arduSynced, tunnelSynced, arduStartTime, tunnelStartTime] = ... time = 0:1 / WT_SAMPLING:size(tunnelData, 1) / WT_SAMPLING; dummy = interp1(arduShort(:, 1), arduShort(:, 2:end), time); arduShort = [time', dummy]; + nanIdx = find(isnan(arduShort(:, 2))); + arduShort(nanIdx:end, :) = []; % Remove extrapolated values % Cut longests dataset - maxTime = max(size(arduShort, 1), size(tunnelData, 1)); + maxTime = min(size(arduShort, 1), size(tunnelData, 1)); arduShort(maxTime:end, :) = []; tunnelData(maxTime:end, :) = []; -- GitLab