title: Is there any function such as repmat for struct in julia?
body: <p>would you please help me. I want to produce a population of struct in Julia.In matalab,we can use repmat for a structure. but in Julia it is impossible. is there any function like repmat in Julia?</p>
  
  <p>for example:</p>
  
  <pre><code>npop=20;
  struct individual
      position
      cost
  end
  
  individual1=individual([],[])
  
  repmat(individual1,npop,1)
  repeat(individual1,npop,1)
  
  </code></pre>
  
  <pre><code>repmat(individual1,npop,1)
  ERROR: MethodError: no method matching repmat(::individual, ::Int64, ::Int64)
  Closest candidates are:
    repmat(::Union{AbstractArray{T,1}, AbstractArray{T,2}} where T, ::Int64, ::Int64) at abstractarray
  math.jl:311
    repmat(::Union{AbstractArray{T,1}, AbstractArray{T,2}} where T, ::Integer, ::Integer) at abstracta
  rraymath.jl:334
    repmat(::AbstractArray{T,1} where T, ::Int64) at abstractarraymath.jl:325
    ...
  Stacktrace:
   [1] macro expansion at C:\Users\admin\AppData\Local\JuliaPro-0.6.4.1\pkgs-0.6.4.1\v0.6\Atom\src\rep
  l.jl:118 [inlined]
   [2] anonymous at .\&lt;missing&gt;:?
  
  julia&gt;
  
  julia&gt; repmat(individual1,npop,1)
  ERROR: MethodError: no method matching repmat(::individual, ::Int64, ::Int64)
  Closest candidates are:
    repmat(::Union{AbstractArray{T,1}, AbstractArray{T,2}} where T, ::Int64, ::Int64) at abstractarray
  math.jl:311
    repmat(::Union{AbstractArray{T,1}, AbstractArray{T,2}} where T, ::Integer, ::Integer) at abstracta
  rraymath.jl:334
    repmat(::AbstractArray{T,1} where T, ::Int64) at abstractarraymath.jl:325
    ...
  Stacktrace:
   [1] macro expansion at C:\Users\admin\AppData\Local\JuliaPro-0.6.4.1\pkgs-0.6.4.1\v0.6\Atom\src\rep
  l.jl:118 [inlined]
   [2] anonymous at .\&lt;missing&gt;:?
  </code></pre>
  
  <p>if loop is used it is possible </p>
  
  <pre><code>pop=individual([],[])
  for i=2:npop
  
      pop=[pop;individual1]
  
  end
  </code></pre>
  
  <p>and </p>
  
  <pre><code>julia&gt; pop
  20-element Array{individual,1}:
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
   individual(Any[], Any[])
  </code></pre>
  
  <p>but I couldn't find a function like repmat in Julia.</p>