Question
MATLAB 1. Write a function called MyTimeConversion with the following function declaration line. 1 function [Hours, Minutes, Message] = MyTimeConversion(TotalMinutes) The input argument TotalMinutes should
MATLAB 1. Write a function called MyTimeConversion with the following function declaration line. 1 function [Hours, Minutes, Message] = MyTimeConversion(TotalMinutes) The input argument TotalMinutes should be a nonnegative scalar integer representing the total number of minutes in a specified time interval. The output arguments Hours and Minutes should be nonnegative scalars such that Hours*60 + Minutes = TotalMinutes and the value of Minutes must be less than 60. The output argument Message must be a string. A few examples below illustrate what its properties should be. Notice that the time units should be singular (i.e., minute, hour) if the value is 1, and plural (i.e., minutes, hours) if the value is not equal to 1 (including 0). Also, if TotalMinutes equals 1, the verb should be is instead of are. For TotalMinutes = 151, Message should equal the string "151 minutes are equal to 2 hours and 31 minutes. For TotalMinutes = 84, Message should equal the string 1 of 3 Available: Feb 12 Spring 2021 Due: Feb 21 "84 minutes are equal to 1 hour and 24 minutes. For TotalMinutes = 60, Message should equal the string "60 minutes are equal to 1 hour and 0 minutes. For TotalMinutes = 181, Message should equal the string "181 minutes are equal to 3 hours and 1 minute. For TotalMinutes = 1, Message should equal the string "1 minute is 0 hours and 1 minute.
1. Write a function called MyTimeConversion with the following function declaration line. function [Hours, Minutes, Message] = MyTimeConversion (TotalMinutes) The input argument TotalMinutes should be a nonnegative scalar integer representing the total number of minutes in a specified time interval. The output arguments Hours and Minutes should be nonnegative scalars such that Hours*60 + Minutes = TotalMinutes and the value of Minutes must be less than 60. The output argument Message must be a string. A few examples below illustrate what its properties should be. Notice that the time units should be singular (i.e., minute, hour) if the value is 1, and plural (i.e., minutes, hours) if the value is not equal to 1 (including 0). Also, if TotalMinutes equals 1, the verb should be is instead of are. For TotalMinutes = 151, Message should equal the string "151 minutes are equal to 2 hours and 31 minutes." For TotalMinutes = 84, Message should equal the string 1 of 3 Available: Feb 12 Spring 2021 Due: Feb 21 "84 minutes are equal to 1 hour and 24 minutes." For TotalMinutes = 60, Message should equal the string -60 minutes are equal to 1 hour and 0 minutes." For TotalMinutes = 181, Message should equal the string "181 minutes are equal to 3 hours and 1 minute." For TotalMinutes = 1, Message should equal the string "1 minute is 0 hours and 1 minuteStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started