App Designer Drop Down to load excel data
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Mario Malic
il 28 Gen 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?
Risposte (1)
Mario Malic
il 28 Gen 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 Commenti
Vedere anche
Categorie
Scopri di più su Spreadsheets in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!