MATLAB: How to import multiple csv files into one and read it from certain folder

csv

I am a newbie in matlab programming. I have a problem in coding to import multiple csv files into one from certain folder:
myDir = uigetdir; %gets directory
myFiles = dir(fullfile(myDir,'*.csv'); %gets all csv files in struct
That is the code. But it only shows the name of csv files, not read the content of the data. Could you please help me to find the code to read all the csv files into one file?
Thank you very much for your help

Best Answer

You can use tabularTextDatatstore to collect the CSV files and read them into one table
>> ds = tabularTextDatastore(filepath,'FileExtensions','.csv')
>> T = readall(ds)
Or if the data is too big, read "chunks"
while hasdata(ds)
T = read(ds);
end