I have a simulation, and I would like to export the parameters and results to a same spreadsheet without overwriting the previous values.
if I have:
parameter1 = {0.1};
parameter2 = {0.2};
result1 = {10};
result2 = {20};
And if I export it I get that. But then if I change the parameters and run the simulation again, I would like these new values to go right after the ones I had previously exported.
parameter1 = {0.1,0.3};
parameter2 = {0.2,0.2};
result1 = {10,25};
result2 = {20,30};
As a spreadsheet or a list with headings would be best. I saw an answer to a similar question recommended creating a spreadsheet beforehand and then defining the cells where the values should be exported to, but this would still rewrite the cells. I guess I could always manually change the location after each simulation. Maybe mathematica has some built-in function to do something like this? I am still very new, I apologize if this question is elementary or doesn't make sense. Any help is much appreciated!
OpenAppendwith streams. Please see example here by WReach stackoverflow.com/questions/7416390/… I do not know if it work for your data/case but worth a try. – Nasser Dec 13 '12 at 14:01PutAppend( short form>>>), which can append expressions to files :{param1,param2,res1,res2}>>>"myfile"– image_doctor Dec 13 '12 at 14:19