How to sort and save the sorted table in app designer?
20 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (2)
KSSV
am 20 Jan. 2022
idx = randperm(10)' ;
x = rand(10,1) ;
T = table(idx,x)
[val,idx] = sort(T.(1)) ;
T = T(idx,:)
1 Kommentar
Nathan Gyger
am 9 Dez. 2022
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 Kommentare
Siehe auch
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!