% This function is part of the NMSM Pipeline, see file for full license.
%
% This function calculates step length asymmetry. Step length asymmetry is
% calculated as the ratio between step lengths, therefore a step length
% asymmetry of 1 represent symmetry.
%
% (struct, struct) -> (Number)
%
function stepLengthAsymmetry = calcStepLengthAsymmetry(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
stepLengthAsymmetry = stepLength(1) / stepLength(2);
end