-4

I have a 1x1x3 matrix A, and a 2-element array s= [m, n]

i need m-by-n tiling of copies of A. so expected output is mxnx3 matrix. Help me to find the correct function for the desired output.

askewchan
  • 45,161
  • 17
  • 118
  • 134
diva
  • 239
  • 1
  • 5
  • 13
  • Illustrating your question with a small example usually makes it easier to understand what you are trying to accomplish - thus it improves your chance of getting a good answer (quickly). – root Apr 04 '13 at 05:26
  • Isn't this pretty much the same [question](http://stackoverflow.com/q/15802430/1191119) that you posted one hour before (and was marked as a duplicate)? The answer is also like the one you accepted in the other question. – jorgeca Apr 04 '13 at 16:23

1 Answers1

2

let the 1x1x3 matrix

A =numpy.array([[[0, 0, 0]]])

and m= 3 and n= 3 then to get the mxnx3 matrix using tile

>>> a=tile((numpy.array([[[0, 0, 0]]])),(3,3,1))
>>> resol_val1 = a.shape
>>> resol_val1 
(3, 3, 3)
>>> a
array([[[0, 0, 0],
        [0, 0, 0],
        [0, 0, 0]],

       [[0, 0, 0],
        [0, 0, 0],
        [0, 0, 0]],

       [[0, 0, 0],
        [0, 0, 0],
        [0, 0, 0]]])
diva
  • 239
  • 1
  • 5
  • 13