Hello,
I know this issue is mentioned a few times here but it is still not clear for me how to fix it.
I am trying to define a function then call it in a different Julia code. For instance, I wrote a code for Euler method as follows
function EulerFun1(f::Function, α::Real, a::Real, b::Real, N::Int64)
n1 = N + 1
u = zeros(n1)
t = zeros(n1)
h = (b - a) / N
u[1] = α
t[1] = a
for i in 2:n1
u[i] = u[i-1] + h * f(t[i-1], u[i-1])
t[i] = a + (i - 1) * h
end
return t, u
end
and I named the file as EulerFun1.jl. When I call the function in a different file like:
include("EulerFun1.jl")
I got this error
LoadError: syntax: { } vector syntax is discontinued around C:\Users\rm18124\EulerFun1.jl:1
in expression starting at C:\Users\rm18124\EulerFun1.jl:1
Stacktrace:
[1] top-level scope
@ C:\Users\rm18124\EulerFun1.jl:1
[2] include(fname::String)
@ Base.MainInclude .\client.jl:451
[3] top-level scope
@ In[61]:1
[4] eval
@ .\boot.jl:373 [inlined]
[5] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1196
Any idea how to handle with this situation?
Thanks,