# a)Extract the data from the two columns into separate arrays named time and distance. b) Determine the velocity and acceleration of the rocket. Use a FOR loop or as many as d

6 views (last 30 days)
anthony sithembiso on 29 Sep 2022
Time Alt
0 0
1 107.37
2 210.00
3 307.63
4 400.00
5 484.60
6 550.00
7 583.97
8 580.00
9 549.53
10 570.00
11 699.18
12 850.00
13 927.51
14 950.00
15 954.51
16 940.00
17 910.68
18 930.00
19 1041.52
20 1150.00
21 1158.24
22 1100.00
23 1041.76
24 1050.00
a)Extract the data from the two columns into separate arrays named time and distance.
b) Determine the velocity and acceleration of the rocket. Use a FOR loop or as many as desired, nested or not, and two nested IF branching structures to solve the question.
clear memory
clear all
clc
time=[rocket_launch(:,1)]';
distance=[rocket_launch(:,2)]';
for k=1:length(time)
for j=1:length(distance)
end
end
i'm not quiet sure how to write the two nested if branching structure inside the for loop structure
##### 2 CommentsShowHide 1 older comment
anthony sithembiso on 29 Sep 2022
by differencing the points

James Tursa on 30 Sep 2022
Hints for using a difference method:
Velocity = ΔPosition / ΔTime
Acceleration = ΔVelocity / ΔTime
To get the delta values, just subtract adjacent points.
anthony sithembiso on 30 Sep 2022
Thank you. I finally got it right using the hint you gave me.

### Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!