# Reshaping Arrays (DimensionMismatch)

**URL:** <https://discourse.julialang.org/t/reshaping-arrays-dimensionmismatch/29545>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [October 6, 2019, 8:04am UTC](https://discourse.julialang.org/t/reshaping-arrays-dimensionmismatch/29545 "2019-10-06T08:04:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asf/32/10610_2.png) [@ASF](https://discourse.julialang.org/u/ASF)\
**Post date:** [October 6, 2019, 8:04am UTC](https://discourse.julialang.org/t/reshaping-arrays-dimensionmismatch/29545/1 "2019-10-06T08:04:31Z")

</div>

Hi - I have the following arrays:  
X = Shape (50562,19)  
theta = Shape (19,)

im trying to do a simple dot product but i get the following error:  
DimensionMismatch(“first array has length 960678 which does not match the length of the second, 19.”)

Any suggestions?

---

<div class="post-metadata">

**Author:** ![improbable22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/improbable22/32/5464_2.png) [@improbable22](https://discourse.julialang.org/u/improbable22)\
**Post date:** [October 6, 2019, 8:35am UTC](https://discourse.julialang.org/t/reshaping-arrays-dimensionmismatch/29545/2 "2019-10-06T08:35:18Z")

</div>

I think you’re looking for `*` not `dot`, different languages differ a bit in how they handle various combinations of matrices & vectors.

```julia
julia> X = rand(50562,19); θ = rand(19);

julia> dot(θ,θ)
5.91416099980499

julia> dot(X,θ)
ERROR: DimensionMismatch("dot product arguments have lengths 960678 and 19")

julia> size(X * θ)
(50562,)

julia> θ * θ
ERROR: MethodError: no method matching *(::Array{Float64,1}, ::Array{Float64,1})

julia> θ' * θ
5.91416099980499

julia> size(θ')
(1, 19)

```
