![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/319111/image.jpeg)
How do I create a dropdown menu for a column in table in matlab app designer ? can somebody help?
24 次查看(过去 30 天)
显示 更早的评论
How do I create a dropdown menu for a column in table in matlab app designer ? can somebody help?
0 个评论
回答(1 个)
Vinayak Mohite
2020-6-19
Hi Rupesh,
According to my understanding of your question, you need a drop-down item list for a column of a table.
I will share my approach to your problem:
Consider the table to be
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/319111/image.jpeg)
Let's say you require drop-down list for the first column.
In your startupFnc, you can set the item property of drop-down equal to the column of the table.
Here is the code for same
function startupFcn(app)
T = table({'A'; 'B'; 'C'}, {'X'; 'Y'; 'Z'});
% Drop down items are set to column 1 of table T.
app.DropDown.Items = T{:, 1};
end
3 个评论
Vinayak Mohite
2020-6-24
Hi Rupesh,
I am assumed that you needed a drop-down list for a table column.
- Drag the drop-down list from the component library(on the left) and drop it in the design view.
- In the component browser (on the right) you could see the name of the drop-down component.
In the answer the component name of the drop-down list was app.DropDown. You have to use items property of the component and set it to the table column.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!