I have 30 txt files with data And I want to create on the fly vectors from that files with the name of "file name"
pathforindependents = 'C:\MatLab\independent\'
independents = dir(fullfile(pathforindependents,'ind*.txt'))
for i = 1:length(independents)
filename = independents(i).name;
r=regexp(filename,'\.','split');
qnumber = r(2)
qtitle=r(3)
qpath = strcat(pathforindependents,filename)
qdata = load(qpath)
mtrxPrefix = 'mtrx_';
v = strcat(mtrxPrefix,qtitle);
eval(???????????????????????)
end
But I dont know how can I do it. No matter what I try Matlab gives me "Undefined function 'eval' for input arguments of type 'cell'." Error?
My data file structure is like
ind.01.AGE.txt
0
1
0
0
0
1
1
0
1
...
At the end I want to reach this
mtrx_AGE =
0
1
0
0
0
1
1
0
1
...
How can I do it ? Thank you.