Problem 44947. Find the Oldest Person in a Room
Solution Stats
Problem Comments
-
15 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.
not that hard
Solution Comments
-
1 Comment
SO EASY
-
1 Comment
Comprehensible code
-
1 Comment
I am puzzled as to why this solution is flagged.
-
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 Solvers12844
Suggested Problems
-
Which values occur exactly three times?
4587 Solvers
-
Given two arrays, find the maximum overlap
1069 Solvers
-
Make an awesome ramp for a tiny motorcycle stuntman
439 Solvers
-
Are all the three given point in the same line?
363 Solvers
-
Remove element(s) from cell array
1034 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!