After asking this question:
how I can read the following files using the for loop: (can the loop ignore the characters in filenames?)
abc-1.TXT cde-2.TXT ser-3.TXT
wsz-4.TXT aqz-5.TXT iop-6.TXT
...(In fact, I have 500 files)
What do I have to add at the beginning of this loop ??
for i = 1:1:500
nom_fichier = strcat(['MyFile.......' num2str(i) '.TXT']);
I tried the following solution :
Names = dir('MyFile\*.TXT');
for i = 1:500
fn = ['MyFile',filesep,Names{i},'-',num2str(i),'.TXT'];
data = load(fn);
.....
After running the program, I got the following error:
??? Cell contents reference from a non-cell array object.
Can you help me to solve this problem. my goal is to read the contents of 500 files.