How do I load text files into the GUI workspace?
1 view (last 30 days)
I have a GUI in which I am trying to load data (from a txt file) from the directory in which the GUI code is at. I will also be manipulating this data within the GUI also.
I have tried the simple load command within the GUI code, but that does not work.
I am thinking of adding buttons and using uigetfile to load the files, but that isn't as discrete as I would like it to be.
Arthur on 29 Nov 2012
Edited: Arthur on 29 Nov 2012
You can get the path to your mfile with mfilename and fileparts:
fname = mfilename('fullpath');
fdir = fileparts(fname);
The best ways to import the textfile are found here: http://www.mathworks.nl/help/matlab/import_export/ways-to-import-text-files.html