Hello.
I have .txt files with some texts (name of variables on the first row) and numbers, so I can't use "load". I would like to extract just numbers in text files (result1.txt, result2.txt … result50.txt) at once.
If I do…
for i=1:50 eval(['txtfile' num2str(i) '= importdata(result' num2str(i) '.txt)']); end
I get an error message "Undefined variable "result1" or class "result1.txt"". Even if I place ' ' or " " like
eval(['txtfile' num2str(i) '= importdata('result' num2str(i) '.txt')']);
and
eval(['txtfile' num2str(i) '= importdata("result' num2str(i) '.txt")']);,
neither of them works. What should I do? Any suggestions are appreciated.
Best Answer