Problem 44947. Find the Oldest Person in a Room
Solution Stats
Problem Comments

14 Comments
In the first test suite, Robinson and Reed both have the same age, so I think either the test suite should be improved or Reed's age in the .mat file should be changed.
Tricky question though
Good one
Interesting
rh x = I don't think you need the [] in your max matrix.
Good job.
where I can get the standard answer?
Easy staff. Don't think too much. First find the maximum age, then use the index of the maximum age and by using that you'll find the corresponding name.
Good problem
idk adam
a challenging problem
Good question
not bad
I solved the problem in MATLAB but on here it did not work. I found the index of the maximum number in the variable age, and then used that to output a name with the same index in the name variable.
Solution Comments

1 Comment
So what this does is it finds the number where age is equal to the max age, and then that corresponding number gives the position of names that has the max name.

1 Comment
nice question

1 Comment
simple

1 Comment
Improved the code to deal with multiple people with the same oldest age

1 Comment
great

1 Comment
This is a good question.

1 Comment
simple indexing problem

1 Comment
Tough problem

1 Comment
its good

1 Comment
Keep in mind you have to obtain the position for the older person. This was taught in the max(var) class. Good luck!

2 Comments
tricky
fist find maximum age then use index of maximum age and by using that find corresponding name

1 Comment
good one.

1 Comment
Even typing only "Old_name = 2" resuts in size to be 13. What logic and language did you apply for getting size 8?
Problem Recent Solvers11444
Suggested Problems

Return the 3n+1 sequence for n
7128 Solvers

1419 Solvers

Find the sum of the elements in the "second" diagonal
1066 Solvers

278 Solvers

特定の値がベクトル内に含まれているかを確認するコードを書こう
211 Solvers
More from this Author13
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!