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.)
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
MATLAB: An Introduction with Applications
- Write the zero vector of M3×4(F).arrow_forwardClaim: A of adults would erase all of their personal information online if they could. A software firm survey of 653 randomly selected adults showed that 61% of them would erase all of their personal information online if they could. Complete parts (a) and (b) below. a. Express the original claim in symbolic form. Let the parameter represent the adults that would erase their personal informationarrow_forwardHelp understand p to q by a vector-valued functionarrow_forward
- Algebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:Cengage