How to sort and save the sorted table in app designer?
조회 수: 18 (최근 30일)
이전 댓글 표시
I am using "uitable" to display an editable and sortable table after reading data from an excel sheet. However, when I sort the data which works fine (using the vertical arrow on the top of each column), it works fine but cannot save the table in the new order of rows (it only save the edited data using the original order of rows). Any idea? I am using the latest version of MATLAB. Thanks.
댓글 수: 0
답변 (2개)
KSSV
2022년 1월 20일
idx = randperm(10)' ;
x = rand(10,1) ;
T = table(idx,x)
[val,idx] = sort(T.(1)) ;
T = T(idx,:)
Nathan Gyger
2022년 12월 9일
Hi Ismaeel,
You can use the DisplayData property of the uitable as this always holds a table that is sorted in the same order as it is selected in the ui.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!