Problem 43665. Use a timetable to analyze a train timetable (Part 2)
Oh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. You can leave after 6:30 but no later than 9:00. (Today is November 1, 2016)
Example:
DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';
ArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';
Destination = categorical({'BOS';'NYC';'BOS'});
tt = timetable(DepTime,Destination,ArrTime)
tt =
DepTime Destination ArrTime
____________________ ___________ ____________________
01-Nov-2016 06:22:00 BOS 01-Nov-2016 09:17:00
01-Nov-2016 08:51:00 NYC 01-Nov-2016 10:32:00
01-Nov-2016 09:05:00 BOS 01-Nov-2016 12:09:00
Feature Tip: R2016b introduces timetables with related functions which may be helpful. To learn more see MATLAB Timetables.
Related Problems:
Use a timetable to analyze a train timetable (Part 2)
Solution Stats
Problem Comments
-
1 Comment
Andrew Newell
on 4 May 2017
The problem statement is incomplete. What happens if there is no train before 9:00?
Solution Comments
Show commentsProblem Recent Solvers72
Suggested Problems
-
Back to basics 11 - Max Integer
801 Solvers
-
Make an awesome ramp for a tiny motorcycle stuntman
734 Solvers
-
Convert a vector into a number
611 Solvers
-
6098 Solvers
-
Calculate Amount of Cake Frosting
28349 Solvers
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!