Creating a pop up menu from a spreadsheet

2 ビュー (過去 30 日間)
Samuel Harding
Samuel Harding 2021 年 2 月 10 日
回答済み: Srijith Kasaragod 2021 年 10 月 26 日
Currently have the following code to create a pop up menu using UI control features
MaterialInput = uicontrol('Style','popupmenu','string',{'Select Material','Alpha Titanium','Aluminium','Beta Titanium','Calcium','Carbon','Carbon (diamond)','Carbon (monoxide)','Chromium','Cobalt (face-centred-cubic)','Cobalt (hexagonal)','Copper','Hydrogen','Iron','Iron Oxide','Magnesium','Magnetite','Manganese','Nickel','Silicon','Zinc'},'Position', [500,600,330,25],'Callback',{@MaterialInput_Callback});
Each of the listed items in the pop up menu can be found in the same column in a spreadhsheet, can i generate this pop up menu straight from the spreadsheet

回答 (1 件)

Srijith Kasaragod
Srijith Kasaragod 2021 年 10 月 26 日
Assuming the items lie in the spreadsheet as a single column, 'readcell' function can be used to return the items as a cell array. The output of 'readcell' function can be passed as the value of 'string' parameter.
Hope this helps!

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by