the following is part of my code, when I run it, I find that data and data1 is only file B5.m, I would like to save all iterations (Example, B11.m to B55.m). finally, I want to add B11 from first folder with B11 from other folder and save it in new folder.
for i = 1:5
for j=1:5
name=['B',num2str(i),num2str(i),'.m'];
name1=['B',num2str(j),num2str(i),'.m'];
data=load([p,name]);
data1=load([w,name1]);
end
end
name
for i = 1 and j = 1 will be equal toname1
(name = B11 and name1 = B11) – m_power Jun 14 '13 at 17:57save
function with the two different folders. Also make sure you closedata
anddata1
for eachj
(hence add aftersave1
,close data;
close data1;
) – m_power Jun 14 '13 at 18:15