If you want elementwise division you have to use the ./ operator. Then each
element gets divided by the corresponding element in the other vector.
On Wednesday, February 5, 2014 8:16:42 AM UTC+1, Andreas Noack Jensen wrote:
I different framing of Kevin's answer could be that it solves your
Can anyone explain what's going on here? :)
julia a = [1,2,3]
3-element Array{Int64,1}:
1
2
3
julia b = [4,5,6]
3-element Array{Int64,1}:
4
5
6
julia a / b
3x3 Array{Float64,2}:
0.0519481 0.0649351 0.0779221
0.103896 0.129870.155844
0.155844 0.194805 0.233766
I get the
Hello Fil,
Generally, division is like multiplying by the inverse of the divisor. For
vectors, the inverse is actually a pseudoinverse or generalized
inversehttp://en.wikipedia.org/wiki/Generalized_inverse.
In this case,
a / b = a * pinv(b)
where
julia pinv(b)
1x3 Array{Float64,2}: