Display only 10 data in uitable

3 ビュー (過去 30 日間)
joni nababan
joni nababan 2020 年 4 月 28 日
コメント済み: joni nababan 2020 年 4 月 28 日
excuse me, i wan to ask how do display only 10 data in uitable
please help me
  4 件のコメント
Geoff Hayes
Geoff Hayes 2020 年 4 月 28 日
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 2020 年 4 月 28 日
10 data from which has the highest value from output column

サインインしてコメントする。

採用された回答

Geoff Hayes
Geoff Hayes 2020 年 4 月 28 日
編集済み: Geoff Hayes 2020 年 4 月 28 日
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 件のコメント
joni nababan
joni nababan 2020 年 4 月 28 日
that's work
Thankyou so much man

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDialog Boxes についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by