Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (23 sloc) 779 Bytes
function [ax,ay,az]=my_acceleration(x,y,z,t)
% Help documentation of "my_acceleration"
% This function computes the acceleration in the x- and y-directions given
% three vectors of position in x- and y-directions as a function of time
% x = x-position
% y = y-position
% z = z-position
% t = time
% output
% ax = acceleration in x-direction
% ay = acceleration in y-direction
% az = acceleration in z-direction
function v=diff_match_dims(x,t)
v=zeros(length(t),1);
v(1:end-1)=diff(x)./diff(t);
v(end)=v(end-1);
end
[vx,vy,vz]=my_velocity(x,y,z,t);
ax = diff_match_dims(vx',t);
ay = diff_match_dims(vy',t);
az = diff_match_dims(vz',t);
%added apostrophe for derivatives of velocity
end
You can’t perform that action at this time.