As an intermediate step to analysis I need to populate a variable called 'files' with the index of current iteration. So far I am doing it manually. I wouldn't like to do it manually for i=1:1000
so I am looking for some automation here, I experimented with many functions but nothing is working. Please help.
Thanks.
Given below is the code snipped I am running.
clear; clc;
for i=1:10
files{i}.data = {
{
['1.csv']
['2.csv']
['3.csv']
['4.csv']
['5.csv']
['6.csv']
['7.csv']
['8.csv']
['9.csv']
['10.csv']
}};
end
Update:
I am using this script
clear; clc;
wdir = 'path\';
all_files = 10;
for i=1:10
files{i}.data = {
{
cellstr(strcat(wdir,num2str((1:all_files).'),'.csv'))
}};
end
Everything is good about this script except the string concat function, It generates space between path and file number for 1..9 files and file no. 10 is perfect. Please help me to fix this.
I am getting something like this.