% This function is part of the NMSM Pipeline, see file for full license.
%
% This function adjusts the tendon slack length for the given muscle in
% both the OpenSim model and the auxiliary data.
%
% (struct, struct) -> (struct)
%
function inputs = applyTendonSlackLengthParameter(inputs, values)
parameterSet = inputs.auxdata.userDefinedVariables;
inputs.auxdata.model = Model(inputs.auxdata.model);
counter = 1;
for i = 1:length(parameterSet)
if strcmp(parameterSet{i}.type, 'tendon_slack_length')
adjustModelTendonSlackLength(inputs.auxdata.model, ...
parameterSet{i}.muscle, values.tendon_slack_length(counter));
inputs = adjustTendonSlackLength(inputs, ...
parameterSet{i}.muscle, values.tendon_slack_length(counter));
counter = counter + 1;
end
end
end