# Generic way to apply function to a dimension of a matrix

**URL:** <https://discourse.julialang.org/t/generic-way-to-apply-function-to-a-dimension-of-a-matrix/54378>\
**Category:** New to Julia\
**Tags:** array\
**Created:** [February 1, 2021, 2:35pm UTC](https://discourse.julialang.org/t/generic-way-to-apply-function-to-a-dimension-of-a-matrix/54378 "2021-02-01T14:35:10Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [February 1, 2021, 7:00pm UTC](https://discourse.julialang.org/t/generic-way-to-apply-function-to-a-dimension-of-a-matrix/54378/6 "2021-02-01T19:00:04Z")

</div>

Just be aware that `eachrow` iterate over `Vector`s not `Arrays{T, 2}` of dimensions `1xN`, [this confused a colleague of mine when he started using Julia](https://discourse.julialang.org/t/eachrow-over-array-any-2-does-not-return-rows-why/34601).

---

_[View the full topic](https://discourse.julialang.org/t/generic-way-to-apply-function-to-a-dimension-of-a-matrix/54378)._
