Skip to main content

getMuscleSpecificSurrogateModelData.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% () -> ()
%


function inputs = getMuscleSpecificSurrogateModelData(inputs)

for i = 1:inputs.numMuscles
counter = 1;
for j = 1:length(inputs.coordinateNames)
for k = 1:length(inputs.surrogateModelCoordinateNames)
if strcmp(inputs.coordinateNames(j), inputs.surrogateModelCoordinateNames(k))
if range(inputs.momentArms(:,k,i)) > inputs.epsilon
inputs.surrogateModelLabels{i}(counter) = ...
inputs.coordinateNames(j);
inputs.muscleSpecificJointAngles{i}(:,counter) = ...
inputs.experimentalJointAngles(:,j);
inputs.muscleSpecificMomentArms{i}(:,counter) = ...
inputs.momentArms(:,k,i);
if isfield(inputs, 'experimentalJointVelocities')
inputs.muscleSpecificJointVelocities{i}(:,counter) = ...
inputs.experimentalJointVelocities(:,j);
end
counter = counter + 1;
end
end
end
end
end
end