How to arrange names in alphabetical order

155 visualizaciones (últimos 30 días)
Judith Amulen
Judith Amulen el 5 de Abr. de 2011
Editada: Stephen23 el 22 de Ag. de 2023
Hey how do i use matlab to arrange names in alphabetical order? a code would be of great help.

Respuesta aceptada

Davide Ferraro
Davide Ferraro el 5 de Abr. de 2011
You can use the SORT command:
An example:
names = {'gamma', 'beta', 'alpha'};
sort(names)
ans =
'alpha' 'beta' 'gamma'
  1 comentario
HAVVA YILMAZ
HAVVA YILMAZ el 7 de En. de 2022
ıs there any way to order without sort function?

Iniciar sesión para comentar.

Más respuestas (1)

Walter Roberson
Walter Roberson el 5 de Abr. de 2011
Arranging names in alphabetical order is a complex topic which depends greatly upon the local rules of what "alphabetical order" mean. For example, in Canadian English, "Judith Amulen" is alphabetically after "Judith de Adele" which in turn is alphabetically after "Judith von Abless" because the prepositions "de" and "von" are not considered to be part of the sorting order.
Where does "ll" sort in Spanish? Where does the German "fat-s" sort? å sorts between z and the next letter in Swedish but sorts last in Norwegian. How do you sort Chinese alphabetically ?
  1 comentario
Stephen23
Stephen23 el 22 de Ag. de 2023
Editada: Stephen23 el 22 de Ag. de 2023
S = ["Judith Amulen", "Judith de Adele", "Judith von Abless"]
S = 1×3 string array
"Judith Amulen" "Judith de Adele" "Judith von Abless"
arbsort(S, ["\s(de|von)\s";" "])
ans = 1×3 string array
"Judith von Abless" "Judith de Adele" "Judith Amulen"

Iniciar sesión para comentar.

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by