필터 지우기
필터 지우기

How to arrange names in alphabetical order

조회 수: 103 (최근 30일)
Judith Amulen
Judith Amulen 2011년 4월 5일
편집: Stephen23 2023년 8월 22일
Hey how do i use matlab to arrange names in alphabetical order? a code would be of great help.

채택된 답변

Davide Ferraro
Davide Ferraro 2011년 4월 5일
You can use the SORT command:
An example:
names = {'gamma', 'beta', 'alpha'};
sort(names)
ans =
'alpha' 'beta' 'gamma'
  댓글 수: 1
HAVVA YILMAZ
HAVVA YILMAZ 2022년 1월 7일
ıs there any way to order without sort function?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2011년 4월 5일
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
Stephen23
Stephen23 2023년 8월 22일
편집: Stephen23 2023년 8월 22일
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"

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by