# MethodError: no method matching Array{Float64,1}(::Array{Float64,2})

**URL:** <https://discourse.julialang.org/t/methoderror-no-method-matching-array-float64-1-array-float64-2/16605>\
**Category:** General Usage\
**Created:** [October 21, 2018, 4:51pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-array-float64-1-array-float64-2/16605 "2018-10-21T16:51:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanz](https://avatars.discourse-cdn.com/v4/letter/r/9de0a6/32.png) [@ryanz](https://discourse.julialang.org/u/ryanz)\
**Post date:** [October 21, 2018, 4:51pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-array-float64-1-array-float64-2/16605/1 "2018-10-21T16:51:12Z")

</div>

Hi, I am using version 1.0.1 and solving a value function iteration problem in parallel. I am attempting to pass “pars” to the “pmap” function. However, I encounter the following error that I have been unable to resolve:

```julia
MethodError: no method matching Array{Float64,1}(::Array{Float64,2})

```

I am using Atom on Ubuntu, and the IDE flags the code in two places marked below.

Here are the relevant excerpts of the code:

```julia
# Data structure of state and exogenous variables
@everywhere struct modelState
  ind::Int64 **# ERROR FLAGGED**
  nϵ::Int64
  nr::Int64
  na::Int64
  nh::Int64
  T::Int64
  age::Int64
  Pϵ::Array{Float64,2}
  Pr::Array{Float64,2}
  agrid::Vector{Float64}
  hgrid::Vector{Float64}
  ϵgrid::Vector{Float64}
  rgrid::Vector{Float64}
  β::Float64
  V::Array{Float64,4}
  w::Float64
end

# CODE OMITTED HERE BUT ALL ELSE RUNS WELL.

for age = T:-1:1

pars = [modelState(ind,nϵ,nr,na,nh,T,age,Pϵ,Pr,agrid,hgrid,ϵgrid,rgrid,β,V_tomorrow,w) for ind in 1:na*nh*nϵ*nr]; **# ERROR FLAGGED**

s = pmap(value,pars)

 for ind = 1:na*nh*nϵ*nr

    ia = convert(Int, floor((ind-0.05)/(nh*nr*nϵ)))+1;
    ih = convert(Int, mod(floor((ind-0.05)/(nr*nϵ)), nh))+1;
    iϵ = convert(Int, mod(floor((ind-0.05)/(nr)), nϵ))+1;
    ir = convert(Int, floor(mod(ind-0.05, nr))+1);

    V[age, ia, ih, iϵ, ir] = s[ind]
    V_tomorrow[ia, ih, iϵ, ir] = s[ind]
  end

```

THANK YOU!!! I would appreciate any help.

---

<div class="post-metadata">

**Author:** ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)\
**Post date:** [October 21, 2018, 4:52pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-array-float64-1-array-float64-2/16605/2 "2018-10-21T16:52:42Z")

</div>

My guess is that you passed a `Matrix` in the position of a field/argument which needs to be a `Vector`.

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [October 21, 2018, 8:25pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-array-float64-1-array-float64-2/16605/3 "2018-10-21T20:25:31Z")

</div>

Just guessing, but maybe you did something like

```julia
julia> [1 2 3]
1×3 Array{Int64,2}:
 1 2 3

```

instead of

```julia
julia> [1, 2, 3]
3-element Array{Int64,1}:
 1
 2
 3

```

?
