引用问这个问题后:Matlab错误:???电池内容物从非单元阵列对象
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']);
我尝试以下溶液:
Names = dir('MyFile\*.TXT');
for i = 1:500
fn = ['MyFile',filesep,Names{i},'-',num2str(i),'.TXT'];
data = load(fn);
.....
运行程序后,我得到以下错误:
??? Cell contents reference from a non-cell array object.
你能帮我解决这个问题吗? 我的目标是阅读500个文件的内容。
你是否必须根据某些特定的文件名模式来阅读它们?或者读取目录中的所有文件就足够了? – tzaman 2010-02-28 15:12:33
我想按照文件名中的数字顺序读取它们 – Matlab09 2010-02-28 17:48:22