Re: vector coding
I have dabbled in vector coding. See below for code I dug up and reference. The last for loop could be eliminated with a more efficient logic test, but I am too lazy to change it.
% this program computes the phase angle between two joint/segment angles joint1 and joint2 (e.g. 100 pt data)
function [phsang] = VectCodeTrials(joint1,joint2)
% find the difference between each point in time
% this will leave you with one less point than the entry matrix
% find the vector magnitude between each xd-yd pair
% use ./ to do the operation on each pt instantly
% cosine and sine for each xd yd pair
%find the phase angle for all 99 points
for j = 1:r
if phsang(j,1) < 0
phsang(j,1) = phsang(j,1) + 360;
Chang, R., Van Emmerik, R., Hamill, J., 2008. Quantifying rearfoot-forefoot coordination in human walking. J. Biomech. 41 (14), 3101–3105.
Tags for this Thread