I created a GUI table with tag "table_handle" using GUIDE. Now how can I enter data into that table? According to the examples, I should be able to use uitable(handles.table_handle, 'Data', dataMatrix), where dataMatrix is the data that I want to enter into the table. However, I get the error undefined function or variable 'table_handle'.
If I replace handles.table_handle with gcf, the table is plopped in the middle of my current window; at least it displays, but I need it to be displayed in it's preset location.
Another problem that I have is that I can not change the default size of the table. In GUIDE, when I open "property inspector", "Data", it shows that there are four rows. If I delete the last three and hit apply, those rows just come back. How can I choose my own dimensions for this table?
thanks.

 Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 11 Jun. 2013

0 Stimmen

It should be
set(handles.table_handle, 'Data', dataMatrix)

6 Kommentare

Peter
Peter am 11 Jun. 2013
Thanks, that worked. Any idea how to make it have the correct number of columns?
Azzi Abdelmalek
Azzi Abdelmalek am 11 Jun. 2013
What is the correct number ?
Peter
Peter am 11 Jun. 2013
Well, I just wanted to know how to choose any arbitrary dimensions for the table. But for my case it is 5 rows, 1 column; but I can neither delete nor add rows/columns using GUIDE.
Why you can not add or delete rows? change your Matrix data, then run again
set(handles.table_handle, 'Data', dataMatrix)
Peter
Peter am 11 Jun. 2013
dataMatrix is a 5 by 1 matrix. Those entries are filled into the table, but there is still an extra column that is just empty. Also, the fifth column is not added until AFTER the program is run. It should be able to display the correct default dimensions before the program is run and then just fill in the values when it is ready.
Faith McColl
Faith McColl am 22 Jul. 2015
Is dataMatrix a matrix or a function?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by