As it is well known, it is possible to define a function that remembers its values once its evaluated, using the following code:

f[x_]:=f[x]=rhs

During the day I evaluate f[x], for many x's, and I do not know/remember at which values of x I evaluated this. These values wont need to be evaluated again until I close mathematica, but if I close it, they will be lost. Is there a way to avoid this? To store these values somehow, so that I can use them the next time I open mathematica?

  • save = DownValues[f] places the arguments and corresponding values of f in save. – bbgodfrey Jun 27 at 3:57
  • 4
    Look at documentation for DumpSave – Bob Hanlon Jun 27 at 4:56
  • @BobHanlon Much better than my answer. Thanks. – bbgodfrey Jun 27 at 5:01
  • I think DumpSave is storing only the definitions of the functions. The evaluations seem to be lost – Fisher Jun 27 at 14:01

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.