Skip to main content

calcExternalForcesPeriodicity.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function calculates the difference between the starting and final
% external force (ground reaction forces for now) for the specified foot
% and force.
%
% (Cell, struct, Array of string) -> (Number)
%


function externalForcesPeriodicity = calcExternalForcesPeriodicity( ...
groundReactionForces, contactSurfaces, forceName)
for i = 1:length(contactSurfaces)
indx = find(strcmp(convertCharsToStrings( ...
contactSurfaces{i}.forceColumns), forceName));
if ~isempty(indx)
externalForcesPeriodicity = diff(groundReactionForces{i}(:, indx));
end
end
end