Hello,

In the help, it is specified that the syntax 'for e = l ...' when l is a list is authorised. When l is replaced by a vector, the result appears to depend on whether its a column or row vector :

With this code, the for loops runs 3 times and each time i is equal to another value of the vector idx

idx =[1 2 3];
for i = idx
    disp("newIter")
    disp(i)
end

When the vector idx is a column vector now, there is only one loop and i is equal to the vector idx

idx = [1 2 3]';
for i = idx
    disp("newIter")
    disp(i)
end

Is this behaviour intended?


Pierre Vuillemin
_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Reply via email to