I want to use “For” here in order to let mathematica calculate my “body-part” several times. But my “body-part” seem a bit large. And then, lot of errors appear. The strange is when I repeat the calculation by my hand that just as “For” should do (just only delete the For[…]), the programm worked.
How can I solve my problem?
Where are the variables inside ClearAll defined in your program? It looks like your problem is that you’re giving For 2 arguments instead of the nominal 4. Take a look at For’s documentation for more information.
Note that For is generally considered bad practice in the Wolfram Language, as there is usually a more elegant way to accomplish a task.
Actually, ignore that. Your problem is that you’re using % to reference the result of the previous computation, but % is the output of the most recent cell, not the last line. Try this attachment.