Cody

# Problem 44947. Find the Oldest Person in a Room

Solution 2926534

Submitted on 8 Sep 2020 by Steven Kunz
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
load patients.mat Age(55) = 12; name = string(LastName); maxAge_correct = "Robinson"; assert(isequal(find_max_age(name,Age),maxAge_correct))

old_n = 100×1 string array "Smith" "Johnson" "Williams" "Jones" "Brown" "Davis" "Miller" "Wilson" "Moore" "Taylor" "Anderson" "Thomas" "Jackson" "White" "Harris" "Martin" "Thompson" "Garcia" "Martinez" "Robinson" "Clark" "Rodriguez" "Lewis" "Lee" "Walker" "Hall" "Allen" "Young" "Hernandez" "King" "Wright" "Lopez" "Hill" "Scott" "Green" "Adams" "Baker" "Gonzalez" "Nelson" "Carter" "Mitchell" "Perez" "Roberts" "Turner" "Phillips" "Campbell" "Parker" "Evans" "Edwards" "Collins" "Stewart" "Sanchez" "Morris" "Rogers" "Reed" "Cook" "Morgan" "Bell" "Murphy" "Bailey" "Rivera" "Cooper" "Richardson" "Cox" "Howard" "Ward" "Torres" "Peterson" "Gray" "Ramirez" "James" "Watson" "Brooks" "Kelly" "Sanders" "Price" "Bennett" "Wood" "Barnes" "Ross" "Henderson" "Coleman" "Jenkins" "Perry" "Powell" "Long" "Patterson" "Hughes" "Flores" "Washington" "Butler" "Simmons" "Foster" "Gonzales" "Bryant" "Alexander" "Russell" "Griffin" "Diaz" "Hayes" old_age = 38 43 38 40 49 46 33 40 28 31 45 42 25 39 36 48 32 27 37 50 48 39 41 44 28 25 39 25 36 30 45 40 25 47 44 48 44 35 33 38 39 44 44 37 45 37 30 39 42 42 49 44 43 47 12 38 41 45 36 38 29 28 30 28 29 36 45 32 31 48 25 40 39 41 33 31 35 32 42 48 34 39 28 29 32 39 37 49 31 37 38 45 30 48 48 25 44 49 45 48 old_age_max = 50 age_position = 20 old_name = "Robinson"

2   Pass
name = ["Renee" "Melanie" "Katrina" "Ethan"]; age = [23 27 19 13]; maxAge_correct = "Melanie"; assert(isequal(find_max_age(name,age),maxAge_correct))

old_n = 1×4 string array "Renee" "Melanie" "Katrina" "Ethan" old_age = 23 27 19 13 old_age_max = 27 age_position = 2 old_name = "Melanie"

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!