# Confusing dimension mismatch error

**URL:** <https://discourse.julialang.org/t/confusing-dimension-mismatch-error/66035>\
**Category:** General Usage\
**Created:** [August 8, 2021, 6:43pm UTC](https://discourse.julialang.org/t/confusing-dimension-mismatch-error/66035 "2021-08-08T18:43:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mcabbott](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcabbott/32/6603_2.png) [@mcabbott](https://discourse.julialang.org/u/mcabbott)\
**Post date:** [August 8, 2021, 7:22pm UTC](https://discourse.julialang.org/t/confusing-dimension-mismatch-error/66035/2 "2021-08-08T19:22:04Z")

</div>

I think this is the same issue as here: [Error in mul!(c,a,b) if size(b) = (n,1) - #8 by lmiq](https://discourse.julialang.org/t/error-in-mul-c-a-b-if-size-b-n-1/47999/8)

tl;dr is that LsqFit’s functions accept anything, but they only actually work with vector input. You probably want to call `vec(p0)` before passing it in, and make sure your function `En` accepts that.

---

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