Skip to main content

calcFinalStateVelocity.m


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


function finalStateVelocity = calcFinalStateVelocity( ...
stateVelocities, coordinateNames, constraintTerm)
indx = find(strcmp(convertCharsToStrings(coordinateNames), ...
constraintTerm.coordinate));
finalStateVelocity = stateVelocities(end, indx) - constraintTerm.target_error;
end