MATLAB: Dear math works i have a data in different files with .out extension, how can i give all the files at once in matlab to read? , kindly help me

load multiple filesread

i have the data from 1979 January to December on daily basis, each having two observations, now i want to read all the years together means from 1979 to 2014. So, how can i read all the files at once

Best Answer

clc; clear all ;
files = dir('*.out');
data = cell(l,length(files)) ;
for i = 1 : length(files)
filename = files(i).name; %the name
thisdata = load(filename); % load this file
data{i} = thisdata ;
end