MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to use package without manually evaluating?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90558] Re: How to use package without manually evaluating?
  • From: "David Park" <djmpark at comcast.net>
  • Date: Sun, 13 Jul 2008 15:46:46 -0400 (EDT)

Jeremy,

 

The way that I would do it is:

 

1) Create a MyApplication (or whatever name you wish) folder in your
$UserBaseDirectory/Applications folder.

2) Make your posted file a Matrices.nb notebook file. Make each of the cells
an Initialization cell.  

3) Change the BeginPackage statement to:

 

BeginPackage["MyApplication`Matrices`"]

 

4) Save the notebook as an "Auto Generated Package" in your MyApplications
folder. (If it already exists as a notebook you can use the Options
Inspector to do this.) This automatically creates the Matrices.m file and
anytime you edit and save the Matrices.nb notebook, the Matrices.m package
file will be updated.

 

5) Load the package with the statement:

 

Needs["MyApplication`Matrices`"]

 

You could make that statement an Initialization cell in your working
notebooks. But when you save those notebooks DON'T  make them Auto Generated
Packages.

 

Generally your private Applications folder is the best place to put
packages. Mathematica automatically knows how to find them there. You may
not want this package loaded EVERY time you use Mathematica. I haven't
examined you package code completely but it seems that you have written some
routines that don't have usage statements. You need a usage statement for
each routine you want to export and have access to.

 

David Park

djmpark at comcast.net

 <http://home.comcast.net/~djmpark> http://home.comcast.net/~djmpark 

 



  • Prev by Date: Re: FindMinimum
  • Next by Date: Re: FindMinimum
  • Previous by thread: Re: How to use package without manually evaluating?
  • Next by thread: Re: How to use package without manually evaluating?