I tried the following example
function test(a,b, obs)
T = typeof(a * b)
Z = Array{T}(obs)
for i in 1:obs
Z[i] = a * b / i
end
return Z
end
test(5.0,2.0, 3)
test(Dual(5.0, 1,0), Dual(2.0, 0,1), 3)
but it errors with ERROR: LoadError: MethodError: no method matching (Array{Float64, N} where N)(::Int64)
. How may I correct this script?
Thanks in advance.