Re: How to construct a matrix like this ?

• To: mathgroup at smc.vnet.net
• Subject: [mg50941] Re: How to construct a matrix like this ?
• From: Paul Abbott <paul at physics.uwa.edu.au>
• Date: Tue, 28 Sep 2004 00:59:24 -0400 (EDT)
• Organization: The University of Western Australia
• References: <cj63a6\$qpr\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```In article <cj63a6\$qpr\$1 at smc.vnet.net>, zhoukm at hotmail.com wrote:

> With Array[a, {2,2}] I can get an array like:
> | a[1,1] a[1,2] |
> | a[2,1] a[2,2] |.
> But occasionally I want matrix like:
> | a11 a12 |
> | a21 a22 |
> I remember I once figured out a way to do it but now I forgot. Anyone
> can give me a hand?

Others have answered this question. Personally, I like

Array[Subscript[a, ##] &, {2, 2}]

or

Table[Subscript[a, i, j], {i,2}, {j,2}]

or

Outer[Subscript[a, ##] &, Range[2], Range[2]]

Cheers,
Paul

--
Paul Abbott                                   Phone: +61 8 6488 2734
School of Physics, M013                         Fax: +61 8 6488 1014
The University of Western Australia      (CRICOS Provider No 00126G)
35 Stirling Highway
Crawley WA 6009                      mailto:paul at physics.uwa.edu.au
AUSTRALIA                            http://physics.uwa.edu.au/~paul

```

• Prev by Date: GUIKit, GraphEdit and global variables
• Next by Date: GUIKit and GraphEdit
• Previous by thread: Re: How to construct a matrix like this ?
• Next by thread: PlotRange-> {0, All}