Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #11701 > unrolled thread

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

Started byMurray Eisenberg <murray@math.umass.edu>
First post2012-09-11 06:34 +0000
Last post2012-09-11 06:34 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Begginer's question: Saving a function for later use Murray Eisenberg <murray@math.umass.edu> - 2012-09-11 06:34 +0000

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

FromMurray Eisenberg <murray@math.umass.edu>
Date2012-09-11 06:34 +0000
SubjectRe: Begginer's question: Saving a function for later use
Message-ID<k2mm12$4v6$1@smc.vnet.net>
Mathematica's memory of a definition lasts as long as, and only as long 
as, a given Mathematica session.

You typed that definition into a notebook (with title probably 
Untitled-1, unless you already saved it with another name).

As long as Mathematica is still open, even if you close a notebook where 
you made a definition such as your "test", that definition is still 
available at the same session -- until you quit Mathematica.

When you start Mathematica again, you must open that notebook and 
evaluate the cell containing your definition.

Or, if you put the definition into a .m package and save that, then you 
must load that package into Mathematica in order to recreate the 
definition.

(There are methods to have such a package automatically loaded each time 
you start Mathematica, but that's getting into something more advanced.)


On Sep 10, 2012, at 4:05 AM, pedro.roberto@campus.ul.pt wrote:

> 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

---
Murray Eisenberg                                     
murray@math.umass.edu
Mathematics & Statistics Dept.      
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                  413 545-2859 (W)
710 North Pleasant Street                      fax   413 545-1801
Amherst, MA 01003-9305





[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web