# Matrix Dimension mismatch

**URL:** <https://discourse.julialang.org/t/matrix-dimension-mismatch/112073>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [March 25, 2024, 10:00am UTC](https://discourse.julialang.org/t/matrix-dimension-mismatch/112073 "2024-03-25T10:00:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)\
**Post date:** [March 25, 2024, 11:02am UTC](https://discourse.julialang.org/t/matrix-dimension-mismatch/112073/2 "2024-03-25T11:02:04Z")

</div>

Hi there!  
Please for your future post try to format them a bit nicer (have a look at [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757/1)).

That being said, I could identify the issue nonetheless.

> [@Sharara](#):
>
> ```julia
> B = [0.4422 0.1761;3.5446 -7.5922;-5.5200 4.49;0 0]
> C = [0 1 0 0]
> [...]
> B * C
> 
> ```

does not work because `B` has size 4x2 and `C` has size 1x4. You probably wanted to create these with different shapes. I recommend reading the manual section on array literals to figure out how the syntax works:  
[https://docs.julialang.org/en/v1/manual/arrays/#man-array-literals](https://docs.julialang.org/en/v1/manual/arrays/#man-array-literals)

---

_[View the full topic](https://discourse.julialang.org/t/matrix-dimension-mismatch/112073)._
