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?

 Réponse acceptée

madhan ravi
madhan ravi le 27 Fév 2019

0 votes

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

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by