I have 100k csv files they are named file-0001, file-0002,...file-9999, file-10000, ... , file-99999, file-100000. I want to read each one at a time, manipulate and store results in matrix for plotting purposes using a single loop. I'm using the code below to make a structure and read them one by one using a loop. Everything is fine until I reach the transition in number of the digits from 4 to 5 and 5 to 6 (i.e. file-9999 to file-10000 and file-99999 to file-100000) at these points MATLAB reads the files improperly and gives me distorted graphs. Would you please help me with an efficient way to acomplish this task?
data =csvread(d(i).name, 1, 0);
p = data(:,4);
norms(i) = norm(p);