Skip to main content

calcMinimizingExternalTorqueControl.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function minimizes the external torque controls for the specified
% coordinates.
%
% (2D matrix, struct, Array of string) -> (Array of number)
%


function cost = calcMinimizingExternalTorqueControl(...
externalTorqueControl, params, coordinate)

indx = find(strcmp(convertCharsToStrings( ...
params.externalControlTorqueNames), coordinate));
cost = calcMinimizingCostArrayTerm(externalTorqueControl(:, indx));
end