blob: c047a35cd8e1a38f3a0c454076bcb40a7339631f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
//Example 3_4
clc();
clear;
//To find acceleration and time taken to stop
v0=5 //units in meters/sec
vf=0 //units in meters/sec
v_1=(v0+vf)/2 //units in meters/sec
x=20 //units in meters
t=x/v_1 //units in sec
a=(vf-v0)/t //units in meters/sec^2
printf("Acceleration is a=%.3f meters/sec^2\n",a)
printf("Time taken to stop t=%d sec",t)
|