Re: About programming Mathematica [Newbie question]

• To: mathgroup at smc.vnet.net
• Subject: [mg32667] Re: About programming Mathematica [Newbie question]
• From: Daniel Reeves <dreeves at mynah.eecs.umich.edu>
• Date: Mon, 4 Feb 2002 03:23:34 -0500 (EST)
• Organization: University of Michigan Engineering
• References: <a3g0rb\$co7\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```You don't have to cut-n-paste into a new notebook cell -- just edit the
cell in place and re-evaluate it (hit shift-enter anywhere within the
cell).

Probably that's all you needed to know, but...

It sounds like the equivalent of what you describe in Octave could be done
with the mathematica function Get.  If you have a file stuff.m with
mathematica code and enter Get["stuff.m"] in a mathematica session, it
will evaluate the contents of the file as if you had entered it all in
right there.

If you really want mathematica to act like a real programming language
(handle command line args, process stdin and stdout, etc) then check out
MASH (for Mathematica Scripting Hack) at
http://ai.eecs.umich.edu/people/dreeves/mash/

Daniel

--- \/   FROM Wyvern AT 02.02.02 06:26 (Today)   \/ ---

> Hi. I'm new to Mathematica and I'm having some trouble understanding what
> metaphor it uses for programming. I've used Octave a bit (I did a simple
> simulation of a pursuit problem) and, in Octave, I simply made a file in
> emacs (with a .m ext) and typed the filename in the Octave command line. Not
> exactly sophisticated, but it was easy. What would the comparable
> Mathematica technique? Surely it cannot be to do a function[] := (and then
> some operations) in a notebook. That would mean that I'd have to do cut and
> paste into a new cell to make any changes, which would certainly be a hassle
> compared  to switching windows and doing c-x c-s, then re-executing inside
> Octave. Surely there is a more elegant solution, something more
> self-contained?
>
> One might ask, if Octave is so darn wonderful, why not do it there? Well,
> it's not very user-friendly, and the whole point of this exercise that I
> need to program is to get familiar with a tool like Mathematica. (I need to
> solve a Hungarian method 10x10 matrix problem.)
>
> If you can point me the right way as regards to programming, I'm pretty sure
> I can throw together an algorithm, but if you could direct me to an
> algorithm for determining the optimal system for finding zero-covering
> lines, I would be very grateful.
>
> Please forgive the obviousness of the solution to my problem... I only got
> this software recently.
>
> Wyvern

--    --    --    --    --    --    --    --    --    --    --    --
Daniel Reeves               http://ai.eecs.umich.edu/people/dreeves/

```

• Prev by Date: RE: Sum expansion
• Next by Date: style sheets