I am using For loop to calculate a value $z$ in every cycle. I would like to create a text file, save the current value $z$ in this file and afterwards delete the value from Mathematica's memory. I would also like to do it as fast as possible.
Example of my loop:
For[x=0,x<=1,x=x+0.5;z=Exp[x^2]]
For[]and similar loops are very inefficient in Mathematica. Why don't you add what are you trying to achieve instead of focusing in the function you want to use. – Dr. belisarius Sep 22 '14 at 18:09Writein the loop? It would almost certainly be faster to save the data and write it out all at once. – george2079 Sep 22 '14 at 18:33