App Designer: Create drop down list from unique table values

1 visualización (últimos 30 días)
mackhina
mackhina el 19 de En. de 2020
Respondida: mackhina el 19 de En. de 2020
Hi everyone,
Is there a work around in App Designer to set the drop down list as unique numbers from a table?
t = readtable('example.xlsx', 'Sheet', 1);
unique_values = table2array(unique((t(:,1))))
app.DropDown.Items = unique_values;
I want to be able to select a unique numerical value from a drop down, then use that numerical value to do a calculation?
Thanks in advance for any help!
Cheers

Respuesta aceptada

mackhina
mackhina el 19 de En. de 2020
This works (although it hurts to look at)...
unique_values = cellstr(num2str(table2array(unique(t(:,1)))));
app.DropDown.Items = unique_values;

Más respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by