# Optimising code: Multiplying a list of matrices by a matrix

**URL:** <https://discourse.julialang.org/t/optimising-code-multiplying-a-list-of-matrices-by-a-matrix/31298>\
**Category:** New to Julia\
**Tags:** question, linearalgebra, tensors\
**Created:** [November 20, 2019, 6:48am UTC](https://discourse.julialang.org/t/optimising-code-multiplying-a-list-of-matrices-by-a-matrix/31298 "2019-11-20T06:48:43Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![GregVernon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gregvernon/32/5611_2.png) [@GregVernon](https://discourse.julialang.org/u/GregVernon)\
**Post date:** [November 21, 2019, 8:51pm UTC](https://discourse.julialang.org/t/optimising-code-multiplying-a-list-of-matrices-by-a-matrix/31298/10 "2019-11-21T20:51:33Z")

</div>

A while ago I asked a similar question, which you might find a useful read:

> [@Multiply many-matrices by many-vectors](https://discourse.julialang.org/t/multiply-many-matrices-by-many-vectors/18542):
>
> All, I have a critical portion of code that essentially involves the multiplication of many pre-computed matrices by many pre-computed vectors. Each matrix multiplies the same, entire list of vectors. Each matrix is the same size (N1xN2) in my current form, but eventually I’d like to remove this requirement, so that each matrix-vector combination can have arbitrary size. In Matlab I might think of this as a cell-array of matrices and a cell array of vectors. But for now I’m just trying to u…

---

_[View the full topic](https://discourse.julialang.org/t/optimising-code-multiplying-a-list-of-matrices-by-a-matrix/31298)._
