Question: Using Matlab. Everytime I try to use the function it tells me function error Write a function nexthour that receives one integer argument, which is
Using Matlab. Everytime I try to use the function it tells me function error
Write a function nexthour that receives one integer argument, which is an hour of the day, and returns the next hour. This assumes a 12-hour clock; so, for example, the next hour after 12 would be 1. If it receives one integer greater than 12 or less then 0, the function will instead return a flag of -100.
Here are examples of using this function: >>nexthour(12)
ans= 1
>>nexthour(2)
ans= 3
>>nexthour(-20)
ans= 100
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
