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 Commento

Oleg Komarov
Oleg Komarov il 19 Apr 2011
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.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Develop Apps Using App Designer in Centro assistenza e File Exchange

Richiesto:

il 19 Apr 2011

Community Treasure Hunt

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

Start Hunting!

Translated by