% This function is part of the NMSM Pipeline, see file for full license.
%
% This function updates the given modeledMarkerPositions argument with the
% marker positions included in markerNames. The modeledMarkerPositions
% struct and markerNames need to match to facilitate this function.
%
% (Model, State, struct, struct, integer) => (double)
% Records the coordinates of the markerNames for the given state
function [modeledMarkerPositions, modeledMarkerVelocities] = ...
findModeledMarkerCoordinates(model, state, modeledMarkerPositions, ...
markerNames, index)
markerNamesFields = fieldnames(markerNames);
for j=1:size(markerNamesFields)
modeledMarkerPositions.(markerNamesFields{j})(:, index) = model. ...
getMarkerSet().get(markerNames.(markerNamesFields{j})). ...
getLocationInGround(state).getAsMat()';
modeledMarkerVelocities.(markerNamesFields{j})(:, index) = model. ...
getMarkerSet().get(markerNames.(markerNamesFields{j})). ...
getVelocityInGround(state).getAsMat()';
end
end