Skip to main content

makeMuscleTendonLengthInitializationValuesAsStruct.m


% This function is part of the NMSM Pipeline, see file for full license.
%
%
% (Array of number, struct) -> (struct)
% Gather optimization values into a struct for use in cost function


function values = makeMuscleTendonLengthInitializationValuesAsStruct(parameterChange, ...
experimentalData)

values.optimalFiberLengthScaleFactors = parameterChange(:, 1 : ...
length(experimentalData.muscleNames));
values.tendonSlackLengthScaleFactors = ...
parameterChange(:, length(experimentalData.muscleNames) + 1 : 2 * ...
length(experimentalData.muscleNames));
values.maxNormalizedFiberLength = ...
parameterChange(:, 2 * length(experimentalData.muscleNames) + 1 : 2 * ...
length(experimentalData.muscleNames) + ...
experimentalData.numMuscleGroups + ...
experimentalData.numMusclesIndividual);
if experimentalData.maximumMuscleStressIsIncluded
values.maximumMuscleStressScaleFactor = parameterChange(:, end);
else
values.maximumMuscleStressScaleFactor = 1;
end
end