Display only 10 data in uitable

3 vues (au cours des 30 derniers jours)
joni nababan
joni nababan le 28 Avr 2020
Commenté : joni nababan le 28 Avr 2020
excuse me, i wan to ask how do display only 10 data in uitable
please help me
  4 commentaires
Geoff Hayes
Geoff Hayes le 28 Avr 2020
So you only want to show 10 rows of data? If so, which 10 rows - the first 10 or the last 10 or every other one?
joni nababan
joni nababan le 28 Avr 2020
10 data from which has the highest value from output column

Connectez-vous pour commenter.

Réponse acceptée

Geoff Hayes
Geoff Hayes le 28 Avr 2020
Modifié(e) : Geoff Hayes le 28 Avr 2020
joni - you could try to use sortrows to sort your data by the last column. Perhaps the following
tableData = [ipk, skor,gjbb,out];
tableData = flipud(sortrows(tableData,4));
set(handles.uitable1,'data',tableData(1:10,:),'ColumnName',{'IPK';'Skor_Perilaku';'Gaji_Beban';'Output'});
We use sortrows to sort the table data using the fourth column. Since the sort order is descending, we use flipud to just flip the matrix so that the sort order is ascending. The top 10 are then extracted using tableData(1:10,:),.
Depending upon your version of MATLAB, you may be able to avoid the flipud and just specify the direction.
  1 commentaire
joni nababan
joni nababan le 28 Avr 2020
that's work
Thankyou so much man

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Dialog Boxes dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by