Updating Table Data not working

2 visualizaciones (últimos 30 días)
Tim Mottram
Tim Mottram el 20 de Sept. de 2012
Hi Guys, This should be simple but I seem to be hitting a brick wall:
I use:
table = uitable('Data',data,'RowNames',rowNames,'ColumnNames',colNames);
I then try:
set(table,'Data',data2)
But I am getting the error "Invalid handle object"
Any thoughts?
Thanks in advance
Tim.

Respuesta aceptada

Matt Fig
Matt Fig el 20 de Sept. de 2012
Editada: Matt Fig el 20 de Sept. de 2012
Where is the second piece of code in relation to the first piece?
Strange, because it works just fine here:
RN = {'a','b','c'};
CN = {'col'};
dat = zeros(length(RN),length(CN));
table = uitable('Data',dat,'RowName',RN,'ColumnName',CN);
dat2 = ones(length(RN),length(CN));
set(table,'Data',dat2)
  10 comentarios
Image Analyst
Image Analyst el 20 de Sept. de 2012
Before you execute the set(table,...) command, set a breakpoint on that line. Then over the mouse over table. Does it give a valid handle number, like 185.2347, or does it say empty or null or something bad like that? Or just type table into the command window and tell us what it says there. It will give the value of table or else say that something's wrong. If it's not a floating point number like I said then you blew it away somehow, perhaps with a call to clear or delete.
Tim Mottram
Tim Mottram el 21 de Sept. de 2012
Hi Guys, I'm really sorry, It was me being a total fool. I was closing the table before I updated the data. I'm really sorry if I have wasted your time. Thanks for all your help and patience.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre App Building en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by