Display only 10 data in uitable
    4 views (last 30 days)
  
       Show older comments
    
    joni nababan
 on 28 Apr 2020
  
    
    
    
    
    Commented: joni nababan
 on 28 Apr 2020
            excuse me, i wan to ask how do display only 10 data in uitable
please help me
4 Comments
  Geoff Hayes
      
      
 on 28 Apr 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?
Accepted Answer
  Geoff Hayes
      
      
 on 28 Apr 2020
        
      Edited: Geoff Hayes
      
      
 on 28 Apr 2020
  
      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.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

