Effacer les filtres
Effacer les filtres

My First GUI: open a file, read the data, select which columns to plot, then plot it

1 vue (au cours des 30 derniers jours)
David C
David C le 18 Jan 2013
This is my first GUI build using GUIDE, please bear with me, as I have watched about a dozen tutorial videos, but have yet to have my question answered.
I have created a GUI with an axes, a push button called "select file", a listbox with parameters of interest, and another push button that says "graph".
In the "select file" button, I have successfully coded it to read the file of interest, and aggregate all the data.
My issue is how do I update/populate the listbox with the headers from the data that I read? Then after the parameter(s) of interest is/are selected, how do I get the "graph" button to generate the graph?
I think what I'm missing is understanding of how I can pass the aggregate data to other functions (which essential are other UI components right?)
All help is highly appreciated. I'm going to continue looking through tutorial videos in the mean while.

Réponses (1)

John Petersen
John Petersen le 18 Jan 2013
Modifié(e) : John Petersen le 18 Jan 2013
To update a listbox with tag "mylistbox" with a cell of strings in mylistboxstr
set(handles.mylistbox, 'String', mylistboxstr);
To graph x,y data on an axes with tag "myaxes"
plot(handles.myaxes, x,y);
Use setappdata() and getappdata() to store and retrieve your data in different functions.
  1 commentaire
David C
David C le 22 Jan 2013
thank you! I will give the setappdata and getappdata functions a try! :)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by