9951 explained code solutions for 126 technologies


julialangHow to fill an array in JuliaLang?


An array in JuliaLang can be filled using the fill function.

arr = fill(0, 5)

This will create an array of 5 elements, each element being 0.

  • fill: This is the function used to fill an array.
  • 0: This is the value used to fill the array.
  • 5: This is the size of the array.

Helpful links

Edit this code on GitHub