Skip to main content

saveGroundContactPersonalizationResults.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% Saves a ground contact .osimx model and experimental and modeled
% kinematics and ground reactions for each foot.
%
% (struct, struct, string) -> (None)
% Save final Ground Contact Personalization results.


function saveGroundContactPersonalizationResults(inputs, params, ...
resultsDirectory, osimxFileName)
[~, name, ~] = fileparts(inputs.bodyModel);
if ~exist(resultsDirectory, "dir")
mkdir(resultsDirectory);
end
writeExperimentalFootKinematicsToSto(inputs, resultsDirectory, name);
writeOptimizedFootKinematicsToSto(inputs, resultsDirectory, name);
writeReplacedExperimentalGroundReactionsToSto(inputs, ...
resultsDirectory, name);
writeOptimizedGroundReactionsToSto(inputs, params, resultsDirectory, name);
writeGroundContactPersonalizationOsimxFile(inputs, resultsDirectory, ...
osimxFileName);
end