% This function is part of the NMSM Pipeline, see file for full license.
%
% This function calculates the resulting muscle moments following the
% completion of the muscle tendon personalization.
%
% (struct, struct, Array of number) -> (Array of number)
% Outputs final muscle moments
function results = calcFinalModelMoments(results, inputs)
[normalizedMuscleFiberLength, normalizedMuscleFiberVelocity] = ...
calcNormalizedMuscleFiberLengthsAndVelocities(inputs, ...
results.optimizedParams(5, :), results.optimizedParams(6, :));
results.modelMoments = calcMuscleJointMoments(inputs, ...
results.muscleActivations, normalizedMuscleFiberLength, ...
normalizedMuscleFiberVelocity);
end