function S=traj1(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=A(2,1); By=A(2,2); alpha=A(3,1); S(:,1) = 4 + Ax.*t - ((Bx-Ax)/alpha).*exp(-alpha.*t) + ((Bx-Ax)/alpha); S(:,2) = 189 + Ay.*t - ((By-Ay)/alpha).*exp(-alpha.*t) + ((By-Ay)/alpha); %plot(S(:,1),S(:,2));