Skip to main content

parseSpaceSeparatedList.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function takes the necessary inputs and produces the results of IK,
% ID, and MuscleAnalysis so the values can be used as inputs for
% MuscleTendonPersonalization.
%
% (struct, struct) -> (None)
% Prepares raw data for MuscleTendonPersonalization


function prefixes = parseSpaceSeparatedList(tree, elementName)
prefixField = getFieldByName(tree, elementName);
if ~isfield(prefixField, "Text")
throw(MException('', strcat(prefixField, " is not in the xml file.")))
end
if ~isempty(prefixField.Text)
if(strcmp(prefixField.Text(1), ' '))
prefixField.Text = prefixField.Text(2:end);
end
prefixes = string(strsplit(prefixField.Text, ' '));
else
prefixes = string([]);
end