Using a file across GUI functions
Show older comments
Hi, I've done a lot of trying to find an answer to my question and can't find a solution.
I'm making a GUI which I want to load in a file (of EEG data) when a pushbutton is pressed, and then be able to call this later on to use in other functions. Below is my code at the moment. I then want the file that I've clicked on when "open" appears from uigetfile to actually be available in the workspace etc. I assume it has something to do with handles.
I hope this makes sense. I'm using GUIDE and very new to it, any help greatly appreciated.
Thanks, Emma
function Load_Callback(hObject, eventdata, handles)
[filename pathname]=uigetfile({'*.*', 'matlab'});
fullfile = strcat(pathname, filename);
load([num2str(fullfile)])
set(handles.data_load, 'String', fullfile) %shows full path name in a text box
set(handles.listbox1, 'String', filename) %shows filename in data list box
2 Comments
Accepted Answer
More Answers (0)
Categories
Find more on App Building in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!