How to calculate lap time
3 views (last 30 days)
Show older comments
I have a code which asks for certain details relating to lap time. I want to do a number of things:
- calculate total distance walked
- calculate distance walked during steady state zone
- calculate speed of each lap throughout whole walk
- plot the entire walk with the steady state zone with a shaded background
% 05: CALCULATE WALKING SPEED DURING TEST prompt = {'Total number of laps', 'Laps During Steady State', ... 'Steady State Start Lap','Steady state Finish Lap', 'Track length (m)'}; walk = 'Enter Walking Data'; defaultans = {'','','','','20'}; Walking = inputdlg(prompt,walk,[1,20],defaultans);
% Calculate total distance walked and steady state distance
prompt = {'Start Phase Time','Lap 1','Lap 2','Lap 3','Lap 4','Lap 5','Lap 6','Lap 7','Lap 8',... 'Lap 9','Lap 10','Lap 11','Lap 12','Lap 13','Lap 14','Lap 15','Lap 16',... 'Lap 17','Lap 18','Lap 19','Lap 20', 'Lap 21','Lap 22','Lap 23','Lap 24','Lap 25',... 'Lap 26','Lap 27','Lap 28','Lap 29','Lap 30','Lap 31','Lap 32','Lap 33',... 'Lap 34','Lap 35','Lap 36','Lap 37','Lap 38','Lap 39','Lap 40'}; def = {'00:00:00','00:00:00','00:00:00','00:00:00','00:00:00','00:00:00','00:00:00',... '00:00:00','00:00:00','00:00:00','00:00:00','00:00:00','00:00:00','00:00:00',... '00:00:00','00:00:00','00:00:00','00:00:00','00:00:00','00:00:00','00:00:00',... '00:00:00','00:00:00','00:00:00','00:00:00','00:00:00','00:00:00','00:00:00',... '00:00:00','00:00:00','00:00:00','00:00:00','00:00:00','00:00:00','00:00:00',... '00:00:00','00:00:00','00:00:00','00:00:00','00:00:00','00:00:00'}; num_lines = 2; lap = 'Enter the time recorded for each lap'; AddOpts.Resize = 'on'; AddOpts.WindowStyle = 'normal'; AddOpts.Interpreter = 'tex'; LapTime = inputdlgcol(prompt,lap,num_lines,def, AddOpts, 5);
% Calculate time of each lap
% Plot walking speed throughout test with steady state zone highlighted
Any suggestions would be greatly appreciated. I am almost positive that I haven't put the right code in for time so any suggestions on how to do it better would be a great help
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!