MathGroup Archive 2004

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

Search the Archive

Re: How to construct a matrix like this ?


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 ?