Created
July 5, 2014 16:32
-
-
Save alexarje/515daeedf48c1a2e810f to your computer and use it in GitHub Desktop.
Plot Quantity of Motion (QoM) of all mocap markers using the MoCapToolbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Read in C3D file | |
a=mcread; | |
% Fill gaps, in case there are holes in trajectories | |
b=mcfillgaps(a); | |
% Calculate velocities for all markers | |
d2v=mctimeder(b); | |
% Calculate vector length (norm/amplitude) of velocities | |
d2vm = mcnorm(d2v); | |
% Plot all velocities | |
figure; | |
plot(d2vm.data(:,:)) | |
% Find QoM sum per marker, leaving out non-numbers | |
s = nansum(d2vm.data); | |
% Normalise by dividing on number of markers | |
sn = s/a.nMarkers; | |
% Create bar plot of data | |
figure; | |
bar(sn) | |
% Transpose data (rotate 90 degrees) | |
r = d2vm.data'; | |
% Calculate QoM over time for entire set, leaving out non-numbers | |
rs = nansum(d2vm.data'); | |
% Normalise by dividing on number of markers | |
rsn = rs/a.nMarkers; | |
% Plot data | |
figure; | |
plot(rsn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment