This有关stackoverflow的问题使用Julia 0.6.1,如下所示:
The convolution function in Julia has the following behaviour:
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: https://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.6.1 (2017-10-24 22:15 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-pc-linux-gnu
julia> conv([1,2,NaN],[1])
3-element Array{Float64,1}:
NaN
NaN
NaN
Julia 1.0.0中的同一件事会产生以下错误输出:
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.0.0 (2018-08-08)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> conv([1,2,NaN],[1])
ERROR: UndefVarError: conv not defined
Stacktrace:
[1] top-level scope at none:0
一个人如何访问Julia 1.0.0中的conv
函数?
答案 0 :(得分:2)
卷积函数已移至代表数字信号处理的软件包DSP.jl中。
通常建议在尝试将pre v0.7代码移植到Julia v1.0时使用Julia v0.7。实际上,这是v0.7存在的唯一原因。
在v0.7中调用conv
时,您会获得所需的所有信息:
julia> conv(rand(10))
ERROR: conv has been moved to the package DSP.jl.
Run `Pkg.add("DSP")` to install it, restart Julia,
and then run `using DSP` to load it.
如果您希望避免在计算机上运行v0.7只是为了查找已移至的位置,还可以在deprecated.jl中搜索旧函数的名称。搜索conv
,我们发现:
for f in [:conv, :conv2, :deconv, :filt, :filt!, :xcorr]
@eval Base.@deprecate_moved $f "DSP"
end
尽管有源代码,但我相信@deprecate_moved "DSP"
是可以理解的。