MathGroup Archive 2014

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

Search the Archive

Re: Building a matrix


On 5/19/14 at 2:03 AM, brunocam at libero.it (Bruno Campanini) wrote:

>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}}

In[1]:= NestList[RotateRight[#, 3] &, PadRight[{1, 2, 3}, 9], 2]
Out[1]= {{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}}




  • Prev by Date: Re: Mathematica inside Excel VBA Macro
  • Next by Date: Re: Building a matrix
  • Previous by thread: Re: Building a matrix
  • Next by thread: Re: Building a matrix