Clear Filters
Clear Filters

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

1 view (last 30 days)
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.

Answers (1)

John Petersen
John Petersen on 18 Jan 2013
Edited: John Petersen on 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.

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!