~~~~~~~~~Posted below is a problem in MATLAB, please answer and provide the corr
ID: 3863722 • Letter: #
Question
~~~~~~~~~Posted below is a problem in MATLAB, please answer and provide the correct coding and functions. Thanks!~~~~~~~~~~~~~~
3. Write a function called generation that asks the user to input his her year of birth and outputs the generation to which that person belongs. The following are the classifications Born between 1943 and 1960 inclusive, classified as baby boomers' Born between 1961 and 1980 inclusive, classified as generation X' Born between 1981 and 2000 inclusive, classified as generation Y Classify anybody born before 1943 and anyone born after 2000 to be generation 'Unknown'Explanation / Answer
function [gen] = generation(year)
gen = 'UNKNOWN';
if year >=1943 && year<=1960
gen = 'BABY BOOMERS';
elseif year >=1961 && year<=1980
gen = 'X';
elseif year >=1981 && year<=2000
gen = 'Y';
end
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.