editing values in uitable.

Hello.
I am having some trouble generating a table.
It should consist out of 2 colums (X and Y)with N+1 rows.
the first column(X) are just numbers counting from 0 to N.
the second column(Y) should contain values generated for each of the values in the first column.
I currently have (the probably not optimal method):
data = rand(N+1,2);
columns = {'X','Y'};
table = uitable('Data',data,'ColumnName',columns);
set(table,'ColumnEditable',[true true]);
I hope this generates a table with 2 columns and N+1 rows. and the last line allows me to edit the colums so I can now change the random numbers to the ones I need in the following parts. However I can't figure out how to do that.
As an alternative if someone could tell me how to add a row with the 2 values to an empty uitable which I think should be possible as well I can change my code to suit with this method.
Thanks in advance,
Dries.- also I'm using 2010a (I've seen there have been some changes to the workings of uitable in recent versions)

댓글 수: 1

Oleg Komarov
Oleg Komarov 2011년 4월 19일
Can't you double-click on the cell and edit it? If you want to add additional rows then you should first get the data, append a new line and reset the new data.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

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

질문:

2011년 4월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by