Find Index of Selected Drop Down in another variable (App Designer)
12 ビュー (過去 30 日間)
古いコメントを表示
Hello Matlab App Developer wizards.
Had a quick question. So I have this drop-down in a matlab app that calls a variable "Yield_raw(:,2)" to create a list. I want to know the index (i.e. row and column) of "Yield_raw" when this is selected. Any pointers? My code looks as follows:
Creates drop down
function ImportYieldFileButtonPushed(app, event)
[Yield_import, Yield_location] = uigetfile('*.xlsx', 'Select Yield File', '\\chlm2efs01\US_Share\');
Yield_raw = readtable([Yield_location, Yield_import]);
Yield_raw = table2cell(Yield_raw(:,[1,3:13]));
if exist('Yield_raw','var')
app.Lamp_Yield.Color ='g';
end
app.ProcessDropDown.Items = Yield_raw(:,2);
Selected drop down
function ProcessDropDownClicked(app, event)
% item = event.InteractionInformation.Item;
%%HOW DO I GET THE INDEX IN YIELD_RAW FOR THE VALUE I SELECTED IN THE DROP DOWN []
end
0 件のコメント
回答 (1 件)
Walter Roberson
2024 年 8 月 5 日
The default Value property of uilistbox is the index of the item selected. If, though, the ItemsData property is set, then the Value property returns the ItemsData entry corresponding to the selected entry.
The ValueIndex property always returns the index of the item selected.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Develop Apps Using App Designer についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!