I made this small meaningless example for you to see my problem:
function a = prova ()
n=5;
i = zeros(n,1);
for i(1) = 1:n %Here is the problem, neither i{1} would work
disp('hello world');
end
a=4;
end
Matlab does not like me using i(1) as my index for the 'for' loop:
Error: File: prova.m Line: 4 Column: 6
Unbalanced or unexpected parenthesis or
bracket.
If I replace i(1) with j, everything works fine. Is not possible to use an array cell to store the indexes of different loops?
I have to do something like:
...
for i5 = 1 : nChannel
for i6 = 1 : nChannel
for i7 = 1 : nChannel
for i8 = 1 : nChannel
for i9 = 1 : nChannel
for i10 = 1 : nChannel
A = aFunction(para, true, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10);
end %all fors
And i wanted to replace it with:
...
for i(5) = 1 : nChannel
for i(6) = 1 : nChannel
for i(7) = 1 : nChannel
for i(8) = 1 : nChannel
for i(9) = 1 : nChannel
for i(10) = 1 : nChannel
A = aFunction(para, true, i_count, i);
end %all fors
At the moment this is my workaround:
for i5 = 1 : nChannel
i(5)=i5;
for i6 = 1 : nChannel
i(6)=i6;
for i7 = 1 : nChannel
i(7)=i7;
for i8 = 1 : nChannel
i(8)=i8;