필터 지우기
필터 지우기

Sort fieldnames in a structure alphabetically ignoring case

조회 수: 8 (최근 30일)
Praveen Choudhury
Praveen Choudhury 2017년 5월 25일
댓글: Praveen Choudhury 2017년 5월 25일
I have a struct. I used orderfields to sort the fieldnames. But it is case sensitive. I am getting Upper case first then the lower case. Is there a way I can sort the fieldnames alphabetically ignoring the case??

채택된 답변

Guillaume
Guillaume 2017년 5월 25일
[~, neworder] = sort(lower(fieldnames(yourstructure)));
newstructure = orderfields(yourstructure, neworder)
would be one way

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by