Skip to main content

calcStepTimeAsymmetry.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function calculates step time asymmetry. Step time asymmetry is
% calculated as the ratio between single support times, therefore a step
% time asymmetry of 1 represent symmetry.
%
% (struct, struct, struct) -> (Number)
%


function stepTimeAsymmetry = calcStepTimeAsymmetry(values, ...
modeledValues, params)

for i = 1:length(params.contactSurfaces)
if i == 1
singleSupportTime(i) = calcSingleSupportTime( ...
modeledValues.groundReactionsLab.forces{i + 1}(:, 2), ...
values.time);
else
singleSupportTime(i) = calcSingleSupportTime( ...
modeledValues.groundReactionsLab.forces{i - 1}(:, 2), ...
values.time);
end
end
stepTimeAsymmetry = singleSupportTime(1) / singleSupportTime(2);
end