how to make a function
4 ビュー (過去 30 日間)
古いコメントを表示
Muhammad Usman Saleem
2015 年 5 月 22 日
コメント済み: Muhammad Usman Saleem
2015 年 5 月 24 日
Hi everyone;
I am going to make a function that takes starting timing of two movies.like hr1,hr2,min1,min2,and their durations, durnmin1,durmin2 and decides whether we can binge and watch both movies. The criteria are that they must not overlap and that we are not going to wait more than 30 minutes between the end of one and the beginning of the next. It returns true if the criteria are both met and returns false otherwise. You may assume that movie start times are always after 1 pm and before midnight. You may also assume that the first one starts earlier. The order of the input arguments is: hr1, min1, durmin1, hr2, min2, durmin2.
I am unable to understand what will my function will do.what are these timing hr1,hr2? why duration has been given.In that function what i have to do...Thanks in advance for assistance
0 件のコメント
採用された回答
Walter Roberson
2015 年 5 月 22 日
You need to add the first duration to the first start time in order to figure out when the first one ends. Then you need to figure out how much time there is between the projected end time of the first one, and the start of the second. If the second one would start before the first one is projected to end then they overlap. If the second one would start more than 30 minutes after the first one is projected to end then they are too far apart to be desired.
5 件のコメント
Walter Roberson
2015 年 5 月 23 日
You did not check for the case where the second one starts before the first one ends.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graphics Performance についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!