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

1 次查看(过去 30 天)
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.

回答(1 个)

John Petersen
John Petersen 2013-1-18
编辑:John Petersen 2013-1-18
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.

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by