function leap_year_list = get_leap_years(start_year, end_year)
A = [start_year : end_year];
for i = start_year : end_year
% I have a function is_leap_year with one input (year) which determines whether that year is a leap year or not. If it is it displays 'True', if not it displays 'False'. I am meant to use that function in another function get_leap_years to output a list of leap years from a range given by two inputs (start_year and end_year).
% I've created an array start_year : end_year and used a for loop with the is_leap_year function. It seems to work but instead of the actual list of years I get True/False.
eg. start_year = 2019, end_year = 2021
When ideally my output should only read 2020, as 2020 is the only leap year for that given range. Any help on how to tackle this is appreciated. Many thanks.