Unknown error with norm() function

I am having trouble with using the basic norm() function after having loaded using LinearAlgebra; In the lines below, Phi is a matrix created in the middle of a larger program.

julia> typeof(Phi)
Array{Float64,2}
julia> x = Phi[:,1];
julia> typeof(x)
Array{Float64,1}
julia> norm(x)
ERROR: MethodError: objects of type Array{Float64,2} are not callable
Use square brackets [] for indexing an Array.
Stacktrace:
 [1] top-level scope at REPL[24]:1

Can anyone tell me what this error message means ? Thank you.

You have a local variable called norm which is a Matrix{Float64} (a.k.a. Array{Float64, 2}), so you are not calling the function norm but instead trying to use your Matrix named norm as if it were a function.

6 Likes

Thank you very much !