Question
A year is a leap year if it is divisible by 400 or if it is divisible by 4 but not by 100. (1) Write
A year is a leap year if it is divisible by 400 or if it is divisible by 4 but not by 100. (1) Write a user-defined MATLAB function (named LeapYear) that takes one single- valued input argument and checks whether the value of the input argument is a leap year. If the input argument is a leaf year, the function should return 1; otherwise, it returns 0. (2) Write a MATLAB script file that calls the LeapYear function and prints to the screen all the years between 1900 and 2100 that are leap years. Note that you can use the disp command to print one number per line.
Step 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