Questions tagged [undefvarerror]

3 questions
2
votes
1 answer

Documenter.jl UndefVarError

I am trying to create a documentation for a Julia module using Documenter.jl. Now I imported a module which documenter cannot find for some reason. More explicitly: I imported SparseArrays.jl via import SparseArrays and am referencing…
2
votes
3 answers

Julia throws undefined error when the variable is defined

I have this simple while loop that uses i = 1 as an index. global i = 1 n = rows while i <= n if prod(isa.(collect((y)[i,:]),Number))==0 delete!(y,i) x_axis = x_axis[1:end .!= i] n -= 1 …
Onur-Andros Ozbek
  • 2,998
  • 2
  • 29
  • 78
1
vote
1 answer

Julia global variable throws UndefVarError

The following code fails. global Θ=1.0 function f(a) c=sin(a+θ) return c end f(1) UndefVarError: θ not defined Stacktrace: [1] f(a::Int64) @ Main ./In[1]:3 [2] top-level scope @ In[1]:6 [3] eval @ ./boot.jl:373 [inlined] [4]…
Rui Sun
  • 31
  • 2