Tag Info

New answers tagged


One can use Block to prevent Plus from evaluating until after result is defined. SortedMonomials = {-3 y, 2 y^2, -3 x, 3 x y, x^2}; Block[{Plus}, result = Plus @@ SortedMonomials; ] Save["/tmp/foo.txt", result] FilePrint["/tmp/foo.txt"] result = -3*y + 2*y^2 - 3*x + 3*x*y + x^2


To use Put or PutAppend with a filename saved in a string in terminal, one can use it in input form rather then >> or >>>, that is: filename="newfile.txt" Put[expression,filename] or PutAppend[expression,filename] I found the answer in http://stackoverflow.com/questions/8853676 by Brett Champion. While this solves my problem, I would ...

Top 50 recent answers are included