App Designer: Create drop down list from unique table values

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

 採用された回答

mackhina
mackhina 2020 年 1 月 19 日

0 投票

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品

リリース

R2019b

質問済み:

2020 年 1 月 19 日

回答済み:

2020 年 1 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by