For Loop Problem in Mathematica

  1. Hello,
    I want to execute a multiline code for each value of the for loop. How can I do that?
  2. jcsd
  3. For[
    i = 0, i < n, i++,
  4. Thanks DaleSpam. I used ',' instead of ';', which was not accepted by Mathematica. This saves a lot of effort.
    Best regards
  5. No problem. You can always use ; to make a compound statement, so it is a general trick that helps elsewhere too.
Know someone interested in this topic? Share this thead via email, Google+, Twitter, or Facebook

Have something to add?