Skip to main content

getMarkersFromBody.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function gets the names of markers attached to a given body.
%
% (Model, string) -> (1D Array of strings)
% Returns the names of markers attached to the body


function markerNames = getMarkersFromBody(model, bodyName)
markerNames = {};
for j=0:model.getMarkerSet().getSize()-1
markerName = model.getMarkerSet().get(j).getName().toCharArray';
markerParentName = getMarkerBodyName(model, markerName);
if(strcmp(markerParentName, bodyName))
if(~markerIncluded(markerNames, markerName))
markerNames{length(markerNames)+1} = markerName;
end
end
end
end