Hello,
I am running an experiment where subjects are completing a 3d reach task with a tool while I am tracking the tool tip position. As a result, I have a matrix of (x,y,z) coordinates (@ 20Hz) captured from a tool tracking device of the reach between two stationary targets. While the distances between the targets is fixed (4.5cm), the reference frame of the tracking devise is not fixed (as it is a portable device). Subsequently, the tracked target positions are relative across all subjects.
I have applied the following code to generate a scatter of the centered and rotated data (XYZ):
xyz0=mean(XYZ);
A=bsxfun(@minus,XYZ,xyz0);
[U,S,V]=svd(A,0);
A_rot = A*V;
A_final = bsxfun(@minus,A_rot,[min(A_rot(:,1)) 0 0]);
scatter3(A_final(:,1),A_final(:,2),A_final(:,3));
I would like to
- Locate the centroid of each target
- determine the vector distance between the target centroids
- determine the time taken to move fro target 1 to target 2
Is cluster analysis required to determine the cluster centroids? If so, may someone suggest a good reference? If I use the mean of each cluster, how can I determine the time taken to move from target 1 to target 2? I assume that I must find the data point that is closest to the target 1 centroid and count the number of frames between that point and the point nearest target 2's centroid?
Any advice and/or references would be greatly appreciated. Many thanks!