% This function is part of the NMSM Pipeline, see file for full license.
%
% This function saves and prints the unscaled results from Tracking
% Optimization.
%
% (struct, struct) -> (None)
% Prints tracking optimization results
function saveTrackingOptimizationResults(solution, inputs)
values = getTrackingOptimizationValueStruct(solution.solution.phase, inputs);
saveCommonOptimalControlResults(solution, inputs, values);
if strcmp(inputs.controllerType, 'synergy_driven')
writeToSto(inputs.muscleLabels, linspace(1, inputs.numSynergies, ...
inputs.numSynergies), [values.synergyWeights], ...
fullfile(inputs.resultsDirectory, "parameterSolution.sto"));
writeToSto(inputs.muscleLabels, values.time, ...
solution.muscleActivations, ...
fullfile(inputs.resultsDirectory, "optimal", "muscleActivations.sto"));
end
end