Hello, I have a sequence of txt files, similar to the one attached, in a folder called 'runfiles'. I am using the code below to these files one by one. However, I am getting an error message. I have tried the same code with other txt files and it worked. Could you please tell me how I can fix this?-Thanks,K.
>>>>>>>ERROR MESSAGE:
"Error using load Unable to read file AbR1997.txt: No such file or directory.
Error in TSaddmissrowsNonLEAP (line 6) ALL=load(filename) %load the file to work with it"
>>>>>>>>CODE USED:
matfiles = dir(fullfile('N:', 'My Documents', 'MATLAB','runfiles', '*.txt'))%go to the folder where you have the files
for n=1997:1999% @@@@@
filename = ['AbR', int2str(n), '.txt'] % @@@@@'sdfhbx' this is the text in the name of the filename that is followed by the sequencial number which is 'i'
ALL=load(filename) %load the file to work with it
end
Best Answer