In a file named "func.jl", I defined the following function:
function testXYZ(xi::Array{T, 1}, yi::Array{T, 1}) where {T<:Float64}
println("Success")
end
In "main.jl" I did build a minimum example:
include("func.jl");
xs = [0.0, 1.2, 2.0, 5.0, 10.0, 11.0]
ys = [2.0, 2.1, 1.0, 0.0, 0.0, 3.0]
testXYZ(xs, ys)
Checking with the console the types of xs and ys, I obtain as expected:
julia> ys = [2.0, 2.1, 1.0, 0.0, 0.0, 3.0];
julia> typeof(ys)
Array{Float64,1}
While exectuting the minimum example in main I obtain a method error:
ERROR: LoadError: MethodError: no method matching +(::Array{Float64,1}, ::String)
In Julia manual, I found lots of similar errors, but no one solved my problem.
+
with two arrays of floats which is fine, however there is no call of+
in your example. I think you are mixing up your files maybe? – tamasgaltestXYZ
function is defined the way you think it is. – StefanKarpinski