0

If I have a small array like a=[1 2 3 4 5], and want to build a large array from it with repeating it, like b=[1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 ....1 2 3 4 5], how can I do that in simplest way and lowest calculations?

user3305284
  • 43
  • 1
  • 8

1 Answers1

1

repmat is what you are looking for

n = 5    
b = repmat(a,1,n)
Steve Osborne
  • 680
  • 4
  • 12