julia> v*v'
1x1 Array{Int64,2}:
14
This is an array, while w[1] is a Float64.
So you need to do something like first(v*v')
or (v*v')[1]
Am Dienstag, 17. Februar 2015 21:04:04 UTC+1 schrieb Christian Dengler:
>
> Hello,
>
> I recently discovered Julia, and tried to convert some of my code. I ran
> into a problem, changing values in a sparse matrix. The entries i want to
> put in the sparse matrix result from a dot product. The error message is
> "ERROR: `convert` has no method matching convert(::Type{Float64},
> ::Array{Float64,1})" The problem can be reproduces with the following lines
> of code.
>
> v = [1 2 3]
> w = spzeros(1, 1)
> w[1] = v*v'
>
> Does anyone know how to solve this?
>
> Thanks,
> Christian
>
> PS: I'm using Julia version 0.3.5 on Linux
>