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: [mg50903] Re: [mg50895] How to construct a matrix like this ?
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Mon, 27 Sep 2004 00:42:10 -0400 (EDT)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

Clear[myArray];

myArray[a_Symbol, 
      {m_Integer?Positive, 
        n_Integer?Positive}] := 
    Table[ToExpression[
          ToString[a]<>ToString[10i+j]],
        {i,m},{j,n}] /; m <10 && n<10;

myArray[a,{2,2}]

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


Bob Hanlon

> 
> From: zhoukm at hotmail.com
To: mathgroup at smc.vnet.net
> Date: 2004/09/26 Sun AM 05:32:12 EDT
> To: mathgroup at smc.vnet.net
> Subject: [mg50903] [mg50895] How to construct a matrix like this ?
> 
> 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
> 
> 


  • Prev by Date: Re: How to construct a matrix like this ?
  • Next by Date: Export to file
  • Previous by thread: Re: How to construct a matrix like this ?
  • Next by thread: Re: How to construct a matrix like this ?