Question: Define a matlab function which takes four ( 4 ) scalar positive integer inputs: month 1 , day 1 , month 2 , day 2

Define a matlab function which takes four (4) scalar positive integer inputs: month1, day1, month2, day2. These represent the birthdates of two babies, both born in 2022. The function should check that each of the input values are of correct types and check that they represent valid dates (each input is a scalar, each input is an integer, both months are within [1,12], both days are within [1, x], x depending on their corresponding months). If any of the inputs provided is incorrect, display a specific message telling about the type of incorrectness. If everything checks out, the function should automatically return a positive scalar integer that is equal to the difference in days between the ages of the two babies. Create a variable named year in which you will store the number of days that each month of a (non-leap) year contains.
The built in function isscalar() as well as a rounding funcon can be useful. Avoid using isinteger().

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!