How do I store the results of a long symbolic calculation for later use?

我怕爱的太早我们不能终老 提交于 2019-12-09 07:18:00

问题


My calculations are something like this:

f[x_]:= (*runs fast*)
g[x_]:=(*runs fast*)
h[x_]=depends on f[x],g[x] (*runs slow ~5mins*)

Now I need only the results of h[x] and every time I restart mma, I essentially redo the same calculations to get h[x], when it could have been stored. Is there some way I can save the symbolic results, and just import it anytime I need it?


回答1:


Try Save

Use like:

Save["h-defs.m", h]

And load with Get:

<< "h-defs.m"


来源:https://stackoverflow.com/questions/5938880/how-do-i-store-the-results-of-a-long-symbolic-calculation-for-later-use

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!