Skip to main content

calcFinalStatePosition.m


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


function finalStatePosition = calcFinalStatePosition( ...
statePositions, coordinateNames, constraintTerm)
indx = find(strcmp(convertCharsToStrings(coordinateNames), ...
constraintTerm.coordinate));
finalStatePosition = statePositions(end, indx) - constraintTerm.target_error;
end