function S=traj2(A,t) %Generates trajectory coordinates as a 2 column vector S(x,y). Takes in %input time t, matrix A. Given S = S0 + At - Bexp(-alpha*t) + B, A(1,:)=A, %A(2,:)=B and A(3,1)=alpha. %Function generates: S = S0 + A(t) - B*exp(-alpha*t) + B %23/09/08: S0 must be changed manually to make the function work! How %should I go about making this more user friendly? %Initialise Parameters Ax=A(1,1); Ay=A(1,2); Bx=11.9373; By=-46.9132; %B is the initial velocity from previous frame alpha=0.4078; %S0 has to be changed in this code manually. S(:,1) = 74.6923 + Ax.*t - ((Bx-Ax)/alpha).*exp(-alpha.*t) + ((Bx-Ax)/alpha); S(:,2) = 86.1376 + Ay.*t - ((By-Ay)/alpha).*exp(-alpha.*t) + ((By-Ay)/alpha); %plot(S(:,1),S(:,2));