Mathematica For Loop with multiple iterators? - Online ...
https://community.wolfram.com/groups/-/m/t/226768For loops can usually (and should) be avoided, since there are better constructs. In your example, it looks like i and j always have the same value, so one of them is redunant. If this is not the intention, but you want all pairs of combinations, then you can use Do: Do [. code. , {i,1,3}, {j,1,2}];
programming - For loops in Mathematica - Mathematica Stack ...
https://mathematica.stackexchange.com/questions/65834/for-loops-in...In Mathematica you can iterate over i != j with. Do[<code>, {i, n}, {j, Drop[Range[n], {i}]}] In a sense it really does the actual iteration desired. The following iterates over all pairs {i, j}, although <code> is executed only for i != j. Do[If[i != j, <code>], {i, n}, {j, …
For—Wolfram Language Documentation
reference.wolfram.com › language › refContinue [] exits the evaluation of body, and continues the loop by evaluating incr. Unless an explicit Return is used, the value returned by For is Null. Note that in an example like For [ tot=0;i=0, i<3, i++, tot+=f [ i]] the roles of the semicolon and comma are reversed relative to C-like programming languages.