Skip to main content

applyOptimalFiberLengthParameter.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function adjusts the optimal fiber length for the given muscle in
% both the OpenSim model and the auxiliary data.
%
% (struct, struct) -> (struct)
%


function inputs = applyOptimalFiberLengthParameter(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, 'optimal_fiber_length')
adjustModelOptimalFiberLength(inputs.auxdata.model, ...
parameterSet{i}.muscle, values.optimal_fiber_length(counter));
inputs = adjustOptimalFiberLength(inputs, ...
parameterSet{i}.muscle, values.optimal_fiber_length(counter));
counter = counter + 1;
end
end
end