MATLAB: How to import files from a folder one at a time


I have many files (>250) named '1.txt','2.txt',etc. If I'm reading them using
Filelist = dir('*.txt')
The information is getting altered in the program (I don't know how). So, I want to read files one by one. like
Filelist = dir('1.txt')
and so on… I can't figure out how to change the file name from 1.txt to 2.txt… after I have read the first file. Kindly help.

Best Answer

  • If the information is getting altered by the program, make a backup copy of the variable?