You can use the "load" function in a loop to load in all the files. If you place all of the files you would like to load into a single directory, you can use the "dir" function to capture the file names. Here is an example:
files = dir('*.txt');
for i=1:length(files)
load(files(i).name, '-ascii');
end
This code will load in all of the files in the directory (assuming they are .txt files) and save them as arrays with the file name as the array name.
Other functions that might be more suitable for your application include "importdata, "textscan", "dlmread" and "readtable".
For more information on importing data into MATLAB refer to the following URL:
One more way of importing multiple files is using "Import Tool". The following documentation page provides steps required to generate the function and call the same using a MATLAB script.
Best Answer