Problem 70. Alphabetize by last name
Given a list of names in a cell array, sort the list by the last name. So if
list = {'Barney Google','Snuffy Smith','Dagwood Bumstead'};
then the output is
alpha_list = {'Dagwood Bumstead','Barney Google','Snuffy Smith'}
Solution Stats
Problem Comments
-
6 Comments
Show
3 older comments
Banister
on 28 Jul 2019
The change in output format was a pain !
Bryan Lambo
on 20 Dec 2019
This blew my mind. Finally got it.
Ahmed Nazir
on 30 Sep 2020
Be careful with output format...
if length(alpha_list) > 5
alpha_list = alpha_list';
end
Solution Comments
Show commentsProblem Recent Solvers2285
Suggested Problems
-
Count from 0 to N^M in base N.
236 Solvers
-
435 Solvers
-
Project Euler: Problem 4, Palindromic numbers
1146 Solvers
-
287 Solvers
-
Remove element(s) from cell array
1746 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!