MATLAB: Dot Operations in MATLAB

dot operations in matlab

format compact;
%
t = 0: 0.1: 2.0; % time in seconds
m = 0.709; % Mass of capsule in Kilograms
F = 62.9 – 60; % Force in Newtons
v0 = 0; % Initial velocity is zero
%
acc = F./m % Acceleration in meters/second
x = t.*v0 + acc.*t.^2 % Position in meters
%
v = v0 + t.*acc; % Velocity in meters/second
%
a = 2.*(v.*t – x)/t.^2 % Acceleration in meters/square second
%
Table = [t', x', v', a'];
fprintf ('\n');
disp (' Time,s Position,m Velocity,m/s Acceleration,m/s2');
fprintf ('%9.2f s%10.2f m%10.2f m/s%15.3e m/s2 \n', Table')
why calculation for a is wrong?

Best Answer

a = 2.*(v.*t - x)./t.^2
% ^---- missed it