# A question on creating an array

**URL:** https://discourse.julialang.org/t/a-question-on-creating-an-array/75439
**Category:** General Usage
**Tags:** question
**Created:** [January 30, 2022, 12:15am UTC](https://discourse.julialang.org/t/a-question-on-creating-an-array/75439 "2022-01-30T00:15:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![leon](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@leon](https://discourse.julialang.org/u/leon)
#### Post date: [January 30, 2022, 12:15am UTC](https://discourse.julialang.org/t/a-question-on-creating-an-array/75439/1 "2022-01-30T00:15:31Z")

</div>

I have a matrix `X1` with the size of `360 * 180`.

My goal is to create an array `X2` with 100 layers, and each layer will have a matrix identical to `X1`, so that my final array `X2` will have a size of `360 * 180 * 100`.

How do I do that? Many thanks!

---

<div class="post-metadata">

### Author: ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)
#### Post date: [January 30, 2022, 12:27am UTC](https://discourse.julialang.org/t/a-question-on-creating-an-array/75439/2 "2022-01-30T00:27:22Z")

</div>

```julia
X2 = repeat(X1; outer=(1,1,100))

```

---

<div class="post-metadata">

### Author: ![leon](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@leon](https://discourse.julialang.org/u/leon)
#### Post date: [January 30, 2022, 12:37am UTC](https://discourse.julialang.org/t/a-question-on-creating-an-array/75439/3 "2022-01-30T00:37:21Z")

</div>

Many thanks for the solution!
