uitable with logical cell (checkbox)

7 visualizaciones (últimos 30 días)
hu
hu el 10 de Dic. de 2013
Comentada: Walter Roberson el 11 de Dic. de 2013
Hi,
How can I know which rows in a uitable with logical cell (checkbox) were selected (upon clicking a button)?
Thanks.

Respuesta aceptada

Walter Roberson
Walter Roberson el 10 de Dic. de 2013
get() the Data property of the table and examine the respective cells.
  6 comentarios
hu
hu el 11 de Dic. de 2013
I still not getting the row numbers (I run you code in a GUI). Can you please upload a full example. Thanks
Walter Roberson
Walter Roberson el 11 de Dic. de 2013
foo = uitable('Data', {false;true;true;false;false}, 'ColumnEdit', true);
Now click on the last entry. Then
data = get(foo, 'Data');
logical_vec = horzcat(data{:});
find(logical_vec)
You should now see that 1 and 4 are not in the list.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Elementary Math 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