Re: Begginer's question: Saving a function for later use

*To*: mathgroup at smc.vnet.net*Subject*: [mg128085] Re: Begginer's question: Saving a function for later use*From*: David Bailey <dave at removedbailey.co.uk>*Date*: Fri, 14 Sep 2012 00:24:55 -0400 (EDT)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com*Delivered-to*: l-mathgroup@wolfram.com*Delivered-to*: mathgroup-newout@smc.vnet.net*Delivered-to*: mathgroup-newsend@smc.vnet.net*References*: <20120910080540.BEE556843@smc.vnet.net> <k2s2np$dph$1@smc.vnet.net>

On 13/09/2012 08:41, Rodrigo AP wrote: > SetDirecrory[your directory] > > Save["test.m",test] > > to load latter: > > <<test.m > > 2012/9/10<pedro.roberto at campus.ul.pt> > >> Hello, >> I'm just getting started on Mathematica and trying to define a function >> for later use. The function is just: >> >> test[x_]:=x^2 >> >> While I don't close mathematica, I can use the function on my notebooks >> but when I close it, the function disappers, I tried to save a .m file with >> it but It didn't work. What do I do? >> >> Thanks for time, >> Pedro >> >> > > Furthermore, you can open the .m file with the File/Open menu directly in the frontend, and edit it much as a notebook. I prefer to do this rather than use real notebooks, because the saved .m file isn't cluttered with output cells. It can, however contain headings, and these are stored as special comments in the saved .m file. David Bailey http://www.dbaileyconsultancy.co.uk

**References**:**Begginer's question: Saving a function for later use***From:*pedro.roberto@campus.ul.pt