Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: How to construct a matrix like this ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg50898] Re: [mg50895] How to construct a matrix like this ?
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Mon, 27 Sep 2004 00:42:04 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 26 Sep 2004, at 18:32, 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?
>
> Regards
>



f[i_, j_] := ToExpression[StringJoin["a", ToString[i],
     ToString[j]]]


Array[f, {2, 2}]


{{a11, a12}, {a21, a22}}


Andrzej Kozlowski
Chiba, Japan
http://www.akikoz.net/~andrzej/
http://www.mimuw.edu.pl/~akoz/


  • Prev by Date: Re: Arg[z] that works with zero argument?
  • Next by Date: Re: Simple questions with Complex Numbers
  • Previous by thread: RE: How to construct a matrix like this ?
  • Next by thread: Re: How to construct a matrix like this ?