Skip to main content

calcStatePositionPeriodicity.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function calculates the difference between the starting and final
% state position for the specified coordinate.
%
% (2D matrix, Cell, Array of string) -> (Number)
%


function statePositionPeriodicity = calcStatePositionPeriodicity( ...
statePositions, coordinateNames, coordinateName)
indx = find(strcmp(convertCharsToStrings(coordinateNames), ...
coordinateName));
statePositionPeriodicity = diff(statePositions(:, indx));
end