Julia中的线性代数
我想用朱莉娅来做一些线性代数。本文档列出了许多适合使用矩阵的函数。其中一些直接用于运行Julia,例如Julia中的线性代数,julia,Julia,我想用朱莉娅来做一些线性代数。本文档列出了许多适合使用矩阵的函数。其中一些直接用于运行Julia,例如 julia> ones(2,2) 2×2 Array{Float64,2}: 1.0 1.0 1.0 1.0 而其他人则给出了一个UndervarError,例如 julia> eye(2,2) ERROR: UndefVarError: eye not defined Stacktrace: [1] top-level scope at none:0 为什么我只能访
julia> ones(2,2)
2×2 Array{Float64,2}:
1.0 1.0
1.0 1.0
而其他人则给出了一个UndervarError
,例如
julia> eye(2,2)
ERROR: UndefVarError: eye not defined
Stacktrace:
[1] top-level scope at none:0
为什么我只能访问线性代数部分列出的一些函数
我还尝试导入LinearAlgebra
包,但这没有什么区别:
julia> using LinearAlgebra
julia> eye(2,2)
ERROR: UndefVarError: eye not defined
Stacktrace:
[1] top-level scope at none:0
事实上,一些函数现在可用,例如,dot
,而根据文档,其他函数也是线性代数库的一部分,继续给出错误:
julia> dot
ERROR: UndefVarError: dot not defined
julia> using LinearAlgebra
julia> dot
dot (generic function with 12 methods)
julia> vecdot
ERROR: UndefVarError: vecdot not defined
上述两个函数在文档中都列为Base.LinAlg.dot
我当前安装的软件包包括:
(v1.0) pkg> status
Status `~/.julia/environments/v1.0/Project.toml`
[0c46a032] DifferentialEquations v5.3.1
[7073ff75] IJulia v1.13.0
[91a5bcdd] Plots v0.21.0
[37e2e46d] LinearAlgebra
[2f01184e] SparseArrays
线性代数页面上讨论的许多其他函数都会出现此问题:
julia> repmat([1, 2, 3], 2)
ERROR: UndefVarError: repmat not defined
Stacktrace:
[1] top-level scope at none:0
我已经安装了Julia vs1.01您链接到的文档不是官方文档,可以在docs.julialang.org上找到。您链接到的文档是某些开发人员网站上的旧版本。这就是它与当前Julia不一致的原因。
eye
现在是LinearAlgebra.I
。我已申请要求Michael删除此存储库,以避免将来出现混淆。