MathGroup Archive 2014

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

Search the Archive

Re: Building a matrix


Hola,

pedestrian but readily understandable:

m = {0, 0, 0};
n = {1, 2, 3};
Table[Flatten[Insert[{m, m}, n, p]], {p, 1, 3}]

{{1, 2, 3, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 2, 3=
, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 2, 3}}

Best regards,

MATTHIAS BODE

> From: brunocam at libero.it
> Subject: Building a matrix
> To: mathgroup at smc.vnet.net
> Date: Mon, 19 May 2014 02:03:51 -0400
>
> Given:
>
> m = [0,0,0}
> n = {1,2,3}
>
> how can I get a function to give:
>
> {{1,2,3,0,0,0,0,0,0}, {0,0,0,1,2,3,0,0,=
0}, {0,0,0,0,0,0,1,2,3}}
>
> ???
>
> Bruno


  • Prev by Date: Re: Building a matrix
  • Next by Date: Re: Building a matrix
  • Previous by thread: Building a matrix
  • Next by thread: Re: Building a matrix