% This function is part of the NMSM Pipeline, see file for full license.
%
% This function calculates stride length.
%
% (struct, struct) -> (number)
%
function strideLength = calcStrideLength(modeledValues, params)
for i = 1:length(params.contactSurfaces)
if i == 1
stepLength(i) = calcStepLength(modeledValues. ...
groundReactionsLab.forces{i}(:,2), ...
[modeledValues.bodyLocations.parent{i}(:, 1) ...
modeledValues.bodyLocations.parent{i+1}(:, 1)]);
else
stepLength(i) = calcStepLength(modeledValues. ...
groundReactionsLab.forces{i}(:,2), ...
[modeledValues.bodyLocations.parent{i}(:, 1) ...
modeledValues.bodyLocations.parent{i-1}(:, 1)]);
end
end
strideLength = sum(stepLength);
end