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일
joni - do you mean ten rows or ten columns, or some combination of row and column so that only ten items appear? (Or do you want to initialize all elements in table to 10?). Please clarify and provide an example.
joni nababan
joni nababan 2020년 4월 28일
Sorry i mean is combination of row and column
So this is mu uitable
and this is my code
out = evalfis([ipk, skor, gjbb],fis)
set(handles.uitable1,'data',[ipk, skor,gjbb,out],'ColumnName',{'IPK';'Skor_Perilaku';'Gaji_Beban';'Output'});
I hope you can help me
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일

0 개 추천

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.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

질문:

2020년 4월 28일

댓글:

2020년 4월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by