MATLAB: How to call a different function for each iteration of a loop

call functionindices

If I have created a set of functions with names corresponding to indices, How do I later call that function with the index I am on? e.g. in a "for" loop, call "minfunt1" on iteration 1, "minfunt2" on iteration 2, etc.?

Best Answer

funcells = cell(15,1);
for jj=1:15
Minsum=minimize6(D0,D1,D2,D3,D4,D5,D6,D7,D8,Data104trans(jj,3:13));
a = sprintf('minfunt%d',jj);
matlabFunction(Minsum,'file',a);
funcells{jj} = str2func(a);
end
use your functions in loop
for jj = 1:15
[x1,x2,x3,x4,x5,x6,x7,x8,x9,]=loop5(funcells{jj},x1,x2,x3,x4,x5,x6,x7,x8,x9);
end