Problem 44947. Find the Oldest Person in a Room

Solution 2255381

Submitted on 5 May 2020 by syed rahim
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))

a2 = 50 idx = 20 a3 = 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_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))

a2 = 27 idx = 2 a3 = 1×4 string array "Renee" "Melanie" "Katrina" "Ethan" old_name = "Melanie"

Suggested Problems

More from this Author13

Community Treasure Hunt

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

Start Hunting!