That last line was probably meant to be
paths = Vector{Matrix{Float64}}(4)
On Tuesday, September 27, 2016 at 7:01:14 PM UTC-4, Yichao Yu wrote:
>
> On Tue, Sep 27, 2016 at 6:28 PM, Zhilong Liu <[email protected]
> <javascript:>> wrote:
> > Hello All,
> >
> > I am trying to return values to elements inside a structure-like matrix.
> > Here is the code snippet:
> >
>
> What you actually meant to write is
>
> paths = [Array{Float64,2}() for i in 1:4]
>
> And you might as well do
>
> paths = Matrix{Float64}(4)
>
> > for i = 1 : 4
> > paths[i] = compute_path(i)
> > end
> >
> > I would like each path[i] element to be a Nx3 matrix. But I got an error
> > saying
> >
> > MethodError: `convert` has no method matching
> > convert(::Type{Array{DataType,1}}, ::Array{Float64,2})
> >
> >
> > Do anyone know how to do this properly?
> >
> >
> > Thanks!
> >
> > Zhilong Liu
> >
> >
>