Skip to main content

pointKinematics.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function uses a mex file or a matlab function with parallel workers
% to calculate the position and velocity of a point.
%
% (Array of number, 2D matrix, 2D matrix, 2D matrix (or Array of number),
% Array of number (or number), Array of string, Cell) -> (2D matrix, 2D matrix)
% Returns point positions and point velocities


function [pointPositions, pointVelocities] = pointKinematics(time, ...
jointAngles, jointVelocities, pointLocationOnBody, body, modelName, ...
coordinateLabels)
if isequal(mexext, 'mexw64')
[pointPositions, pointVelocities] = pointKinematicsMexWindows(time, ...
jointAngles, jointVelocities, pointLocationOnBody', body, ...
coordinateLabels);
else
[pointPositions, pointVelocities] = pointKinematicsMatlabParallel(time, ...
jointAngles, jointVelocities, pointLocationOnBody, body, modelName, ...
coordinateLabels);
end
end