Add new rows to Table (GUI uitable)

Hey guys! After some research, I still can't find the solution for my problem. I have a table that it's filled with info from user, when a button is pushed. The idea is that once new information is inserted and the "add" button pushed, a new row is created on the table and the info copied there, without deleting/overwrite previous data.
Does any of you have a suggestion?? Your help is very much appreciated!
Thanks! BS.

4 comentarios

Jan
Jan el 4 de Jul. de 2013
What have you tried already? Did any problems occur?
BSantos
BSantos el 4 de Jul. de 2013
I tried to follow this http://www.mathworks.com/matlabcentral/newsreader/view_thread/250393 but did not work for me.
Basically, I could write on a 2nd row but the data on the 1st one is gone. Help anyone??? Thanks!
Jan
Jan el 4 de Jul. de 2013
The linked thread is totally unrelated to the topic of uitable. Therefore we cannot guess, how you try to write to the 2nd row. Please post your code instead of hoping, that we have crystal balls ;-)
BSantos
BSantos el 4 de Jul. de 2013
Crystal balls would be nice every now and then... ;) Thanks for the support anyway. With Tom's answer I could solve my problem!
Cheers, BS.

Iniciar sesión para comentar.

 Respuesta aceptada

Tom
Tom el 4 de Jul. de 2013
%hTable: handle to the table
%newRow : the row of data you want to add to the table.
oldData = get(hTable,'Data');
newData = [oldData; newRow];
set(hTable,'Data',newData)

1 comentario

BSantos
BSantos el 4 de Jul. de 2013
Tom, Thanks a LOT!!! This just solved my problem!!!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre App Building en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 4 de Jul. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by