How to insert values into a listbox from selecting data from another listbox
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Alexander McIntyre
le 11 Mar 2021
Réponse apportée : Monisha Nalluru
le 17 Mar 2021
I am creating a GUI to make producing graphs from many different files and data options easier as seen in the image below. To begin, the user presses the Data pushbutton. The folder from which the MATLAB file is located will open. Each excel file within that folder will automatically be uploaded into the Data set 1 and 2 listboxes.
Each of these excel files has 35-40 variables that I want to have broadcasted into the Command 1 (Data set 1) and Command 2 (Data set 2) window. I would like to be able to click the populated excel file in the top listboxes and be able to populate the bottom listboxxes. How do I do this? Thanks.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/546732/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/546737/image.png)
0 commentaires
Réponse acceptée
Monisha Nalluru
le 17 Mar 2021
From my understanding, you want to display the data of selected excel file in Command 1 listbox
This can achieved by adding valueChanged Callback on DataSet1 and following the steps:
function ListBoxValueChanged(app, event)
% get filename from previous box
% load the file and process the data
% convert the data to string and cell 1 D
% update the list box 'Items'
end
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!