![Matlab](https://www.bartleby.com/isbn_cover_images/9781119299257/9781119299257_largeCoverImage.jpg)
Write a user-defined MATLAB
TA is a two-element
ap1 is a string ‘AM’ or ‘PM’ which corresponds to the time of the first event.
TB is a two-element vector with the time of the second event. The first element is the hour and the second element is the minute.
ap2 is a string ‘AM’ or ‘PM’ which corresponds to the time of the second event.
The output argument dt is a two-element vector with the time elapsed between two events. The first element is the number of hours and the second element is number of minutes.
The function displays an error message if the time entered for event B is before the time entered for event A.
Use the function to determine the time elapsed between the following events:
(a) Event A: 5:37 AM: Event B: 2:51 PM.
(b) Event A: 12:53 PM: Event B: 6:12 PM.
(c) Event A: 11:32 PM: Event B: 3:18 PM. (Error situation.)
![Check Mark](/static/check-mark.png)
Want to see the full answer?
Check out a sample textbook solution![Blurred answer](/static/blurred-answer.jpg)
Chapter 7 Solutions
Matlab
- Algebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:CengageMathematics For Machine TechnologyAdvanced MathISBN:9781337798310Author:Peterson, John.Publisher:Cengage Learning,
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337798310/9781337798310_smallCoverImage.jpg)