MATLAB: Anyone can help me how to find the oldest person in a room

name

anyone can help me how to find the oldest person in a room?
i have write code :
old_name=name(max(age))
first access the max age the pass it to the name to get the name of oldest man.
is it true or not??
please guide me
Thanks in advance

Best Answer

No. This returns the persons age. You want the index, so you'll have to do this in 2 steps. See the documentation for max to see how to get the index of the max value.