Find Index of Selected Drop Down in another variable (App Designer)
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’, ‘\chlm2efs01US_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 []
endHello 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’, ‘\chlm2efs01US_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 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’, ‘\chlm2efs01US_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 appdesigner, app designer, graph, matlab, matrix, input, index, indexing, find, sort, import, integration, matrices, matlab gui, matlab code, mathematics, matrix array, matlab coder, matlab function, matlab compiler, matrix manipulation, embedded matlab function, function, functions MATLAB Answers — New Questions