I have several nested loops that allow me to build a matrix of 21 row by 20000 columns.
Each column of the array above has a string associated which I store in a variable called filename at each loop iteration (the string gets replaced at each iteration).
Is there any what to create a vector (1-by-20000) with the strings so that I can then export to Excel?
clear all
n = 201;
PP=[];
pathname = 'D:\';
addpath(pathname);
for Y = 1:20
for B = 1:2
for z = 1:50;
for R = 1:2;
for I = 1:5;
filename = strcat('F', num2str(Y),'_',num2str(B),'_',num2str(z),'_',num2str(R),'_',num2str(I),'_',num2str(C),'.txt');
aux = load(filename);
PP = [PP aux(1:n)];
end
end
end
end
rmpath(pathname)