필터 지우기
필터 지우기

App Designer: Create drop down list from unique table values

조회 수: 2 (최근 30일)
mackhina
mackhina 2020년 1월 19일
답변: mackhina 2020년 1월 19일
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일
This works (although it hurts to look at)...
unique_values = cellstr(num2str(table2array(unique(t(:,1)))));
app.DropDown.Items = unique_values;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by