Re: Queries: notebook, matrices

• To: mathgroup at smc.vnet.net
• Subject: [mg27015] Re: Queries: notebook, matrices
• From: "Paul Lutus" <nospam at nosite.com>
• Date: Tue, 30 Jan 2001 23:22:32 -0500 (EST)
• References: <9562tq\$6q@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

"M. Damerell" <uhah208 at rhbnc.ac.uk> wrote in message
news:9562tq\$6q at smc.vnet.net...

> 1. I do a lot of calculation in a notebook, save it,
> then when I restart Math & open the file I have to
> recalculate each item before I can resume where I
> left off.  Is there any way to tell Math to recalculate
> everything when the file is reopened?

Put all the initialization material in cells that you identify as
"initialization cells." Look this term up in the help file to see how to
proceed. On the current Windows version, simply choose Cell ... Cell
Properties .. Initialization Cell.

> 2. I enter a matrix as (say)  A={{1,2,3},{4,5,6} etc
> and it displays in that form. Is there any way to make
> Math display matrices as matrices? I know you can do
>
> B=A.A//MatrixForm
>
> this looks right but Math doesnt know this is a matrix.
> So I would like matrices to be held internally in list
> form but displayed in matrix form.

Actually, Mathematica usually knows what to do with MatrixForm. Maybe you
should post an example where there is an error in interpretation while using
MatrixForm. Also, you can easily go back and forth between forms:

a = Table[Table[Random[],{i,5}],{j,5}]//MatrixForm

b = a[[1]] (* removes the MatrixForm wrapper *)

To help you see how to do these "tricks," to see how Mathematica interprets
these objects internally, use:

FullForm[a] (* shows how Mathematica represents the object internally *)

Also, there is always the option of only applying "MatrixForm" when you want
to display the matrix, not while computing:

c = Table[Table[Random[],{i,5}],{j,5}];

c // MatrixForm (* display only *)

> 3. and finally, is there any way to export the matrix
> into  Excel?

Here is an example using our "c" table above:

Export["temp.csv",c]

The file suffix "csv" is important, both for Mathematica and for Excel. Open
the resulting file in Excel (or any program that can read comma-separated
values).

--
Paul Lutus
www.arachnoid.com

• Prev by Date: Re: Unevaluated Expression
• Next by Date: Re: Any better way for finding frequencies of list entries?
• Previous by thread: Re: Queries: notebook, matrices
• Next by thread: Re: Queries: notebook, matrices