Skip to content

Instantly share code, notes, and snippets.

@alexarje
Created July 5, 2014 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexarje/515daeedf48c1a2e810f to your computer and use it in GitHub Desktop.
Save alexarje/515daeedf48c1a2e810f to your computer and use it in GitHub Desktop.
Plot Quantity of Motion (QoM) of all mocap markers using the MoCapToolbox
% 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