Reputation: 31
I would like some guidance on how to import multiple .txt files containing data seperated by comma on a MATLAB GUI. Once the files are uploaded, I have a function that will manipulate all the data from each .txt file.
Any help is appreciated.
Upvotes: 0
Views: 276
Reputation: 1482
Try uigetfile
to launch a dialog for loading files. Set 'MultiSelect'
to 'on'
in order to select multiple files at once.
Here's an example call:
[filenames, pathname] = uigetfile({'*.txt; *.csv','Comma separated values';...
'*.*','All files'},'Select files','MultiSelect','on');
You will need to check if the user actually selected a file or if they canceled.
If I understand your question correctly, you have a GUI already. In this case you just need to add the above call to your designated callback function (i.e. whatever you click to invoke this file load interface).
Upvotes: 0
Reputation: 1878
The easiest way to import multiple files is to:
Upvotes: 0