# Stack with new axis last

**URL:** <https://discourse.julialang.org/t/stack-with-new-axis-last/119090>\
**Category:** General Usage\
**Tags:** arrays\
**Created:** [September 5, 2024, 9:47pm UTC](https://discourse.julialang.org/t/stack-with-new-axis-last/119090 "2024-09-05T21:47:06Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [September 7, 2024, 2:45pm UTC](https://discourse.julialang.org/t/stack-with-new-axis-last/119090/3 "2024-09-07T14:45:05Z")

</div>

@mcabbott, what are the advantages of your proposed solution over OP’s original idea of using: `permutedims(stack(a),(2,3,1)) ` ?

Thanks.

NB:  
[This post](https://discourse.julialang.org/t/memory-allocation-when-using-permutedims/105806/2) answers the question.

---

_[View the full topic](https://discourse.julialang.org/t/stack-with-new-axis-last/119090)._
