App Designer Drop Down to load excel data
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have an excel sheet which has the first colum being a name, each colum after has numerical data accociated with each name (Name and date acociated with name have ther own row). I would like to use a drop down to select the name from the excel document which would in turn pull in all the data asociated with that name. The list of names from the drop down also needs to be pulled from the first colum in the excel document since it is a living document.
2 comentarios
Mario Malic
el 28 de En. de 2021
Hello,
This is highly reliant on how your Excel data is structured. Is there a pattern where the data associated with the person is located?
Respuestas (1)
Mario Malic
el 28 de En. de 2021
If you use readtable on your file, you'll get a nice table already prepared with the data. After you import, check if your numbers are actually imported as numbers.
t = readtable('filename.xlsx');
app.DropDownMenu.Items = t{:,1};
app.DropDownMenu.ItemsData = 1:length(app.DropDownMenu.Items);
When you set the ItemsData property this way, the number will be present in the Value property, and you can use it to index into particular rows of the table.
selectedRow = app.DropDownMenu.Value;
0 comentarios
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!