I have tried to import several csv files into one file. However, the new file overwrites the “original” ones.
Only the last processed one among them was imported. Something may be wrong about the loop, but I don’t know where to change.
This is what I have:
p=dir('C:\foldername\*.csv');
for i=1:length(p)
[num, text, all]= xlsread(['C:\foldername\', p(i).name]);
end
You are overriding the variables in the loop.
Try to collect everything in cell array: